[PATCH libX11] poll_for_response: Really handle xcb_poll_for_reply getting a reply.

Pauli Nieminen suokkos at gmail.com
Tue Jan 18 14:02:45 PST 2011


From: Jamey Sharp <jamey at minilop.net>

Don't lose async replies. That's bad.

`xlsfonts -l`, which uses XListFontsWithInfo, worked fine, because the
_XReply path worked; that path waited for replies, rather than polling.

However, XRecordProcessReplies, which does nothing but call XPending,
relied on the event-handling path to process async replies, and that was
busted.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=28595

Signed-off-by: Jamey Sharp <jamey at minilop.net>
(cherry picked from commit 978c7238789037de917b9423ea9adfb006da1260)

Cherry pick without conflicts from master to 1.3 branch.

Signed-off-by: Pauli Nieminen <suokkos at gmail.com>
---
 src/xcb_io.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/xcb_io.c b/src/xcb_io.c
index 72881d8..7e685de 100644
--- a/src/xcb_io.c
+++ b/src/xcb_io.c
@@ -239,8 +239,9 @@ static xcb_generic_reply_t *poll_for_response(Display *dpy)
 	{
 		assert(XLIB_SEQUENCE_COMPARE(req->sequence, <=, dpy->request));
 		dpy->last_request_read = req->sequence;
-		if(!response)
-			dequeue_pending_request(dpy, req);
+		if(response)
+			break;
+		dequeue_pending_request(dpy, req);
 		if(error)
 			return (xcb_generic_reply_t *) error;
 	}
-- 
1.7.3.4



More information about the xorg-devel mailing list