+ /* For reply packets, check that the entire packet is available. */
+ if(genrep.response_type == 1)
+ {
+ pending_reply *pend = _xcb_list_peek_head(c->in.pending_replies);
+ if(pend && pend->request == c->in.request_read)
+ {
+ switch(pend->workaround)
+ {
+ case WORKAROUND_NONE:
+ break;
+ case WORKAROUND_GLX_GET_FB_CONFIGS_BUG:
+ {
+ CARD32 *p = (CARD32 *) c->in.queue;
+ genrep.length = p[2] * p[3] * 2;
+ }
+ break;
+ }
+ free(_xcb_queue_dequeue(c->in.pending_replies));
+ }
+ length += genrep.length * 4;
+ }
+
+ buf = malloc(length);
+ if(!buf)
+ return 0;
+ if(_xcb_in_read_block(c, buf, length) <= 0)
+ {
+ free(buf);
+ return 0;
+ }
+