From 46f5ae54c4a898002c80b2183ec8ed16dc922d06 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 3 Nov 2010 22:33:07 +0000 Subject: Change in behaviour was causing xcalc to not resize properly anymore. Now the implementation is the same again as the previous version. --- libxcb/src/xcb_conn.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c index e7b02dfd3..3a8eafa76 100644 --- a/libxcb/src/xcb_conn.c +++ b/libxcb/src/xcb_conn.c @@ -183,7 +183,7 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) #ifdef _WIN32 int i = 0; - int ret = 0,err = 0; + int cnt=*count; struct iovec *vec; n = 0; assert(!c->out.queue_len); @@ -191,20 +191,34 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) /* Could use the WSASend win32 function for scatter/gather i/o but setting up the WSABUF struct from an iovec would require more work and I'm not sure of the benefit....works for now */ vec = *vector; - while(i < *count) + while(i < cnt) { - ret = send(c->fd,vec->iov_base,vec->iov_len,0); + char *p= vec->iov_base; + size_t l= vec->iov_len; + while (l > 0) + { + int ret = send(c->fd, p, l, 0); if(ret == SOCKET_ERROR) { - err = WSAGetLastError(); + int err = WSAGetLastError(); if(err == WSAEWOULDBLOCK) { - return 1; + if (n) + { + /* already return the data */ + i=cnt; + break; + } + else + return 1; } } + p += ret; + l -= ret; n += ret; - vec++; - i++; + } + vec++; + i++; } #else assert(!c->out.queue_len); -- cgit v1.2.3