Fix Keith's 32-bit wrap fix.
authorJamey Sharp <jamey@minilop.net>
Sun, 30 Jul 2006 21:55:14 +0000 (14:55 -0700)
committerJamey Sharp <jamey@minilop.net>
Mon, 31 Jul 2006 00:03:27 +0000 (17:03 -0700)
Issue 0, 1, or 2 syncs as needed and do not handle 16-bit wrap until
absolutely necessary.

src/xcb_out.c

index 9a67ad2..56e02f7 100644 (file)
@@ -163,8 +163,8 @@ unsigned int XCBSendRequest(XCBConnection *c, int flags, struct iovec *vector, c
      * Also send sync (could use NoOp) at 32-bit wrap to avoid having
      * applications see sequence 0 as that is used to indicate
      * an error in sending the request */
      * Also send sync (could use NoOp) at 32-bit wrap to avoid having
      * applications see sequence 0 as that is used to indicate
      * an error in sending the request */
-    if((req->isvoid &&
-       c->out.request == c->in.request_expected + (1 << 16) - 2) ||
+    while((req->isvoid &&
+       c->out.request == c->in.request_expected + (1 << 16) - 1) ||
        request == 0)
     {
         prefix[0] = sync.packet;
        request == 0)
     {
         prefix[0] = sync.packet;