X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fxcb_out.c;h=1faf2a5d1c64bb569e417848ab21d92bf096d7f1;hb=c491eeb9a9f670f7d4869d7dae7a5adce4565998;hp=c4ef73764f66e2223507d507dff633666f00077d;hpb=e5458e477db95e1e064e46ca28245ecd51b5b524;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_out.c b/src/xcb_out.c index c4ef737..1faf2a5 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -136,7 +136,7 @@ unsigned int XCBSendRequest(XCBConnection *c, int flags, struct iovec *vector, c while(c->out.writing) pthread_cond_wait(&c->out.cond, &c->iolock); - if(req->isvoid && c->out.request == c->in.request_expected + (1 << 16) - 1) + if(req->isvoid && c->out.request == c->in.request_expected + (1 << 16) - 2) { prefix[0] = sync.packet; request = ++c->out.request; @@ -237,7 +237,7 @@ int _xcb_out_write(XCBConnection *c) int _xcb_out_write_block(XCBConnection *c, struct iovec *vector, size_t count) { assert(!c->out.vec && !c->out.vec_len); - while(count && c->out.queue_len + vector[0].iov_len < sizeof(c->out.queue)) + while(count && c->out.queue_len + vector[0].iov_len <= sizeof(c->out.queue)) { memcpy(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len); c->out.queue_len += vector[0].iov_len;