allow compile-time setting for XCB queue buffer size
[free-sw/xcb/libxcb] / src / xcb_in.c
index 27ccc99..f613772 100644 (file)
@@ -77,8 +77,8 @@ static void wake_up_next_reader(xcb_connection_t *c)
 static int read_packet(xcb_connection_t *c)
 {
     xcb_generic_reply_t genrep;
-    int length = 32,
-        eventlength = 0; /* length after first 32 bytes for GenericEvents */
+    int length = 32;
+    int eventlength = 0; /* length after first 32 bytes for GenericEvents */
     void *buf;
     pending_reply *pend = 0;
     struct event_list *event;
@@ -191,6 +191,7 @@ static int read_packet(xcb_connection_t *c)
         if(!cur)
         {
             _xcb_conn_shutdown(c);
+            free(buf);
             return 0;
         }
         cur->reply = buf;
@@ -252,7 +253,7 @@ static void free_reply_list(struct reply_list *head)
     }
 }
 
-static int read_block(const int fd, void *buf, const size_t len)
+static int read_block(const int fd, void *buf, const ssize_t len)
 {
     int done = 0;
     while(done < len)