aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-03 22:33:07 +0000
committermarha <marha@users.sourceforge.net>2010-11-03 22:33:07 +0000
commit46f5ae54c4a898002c80b2183ec8ed16dc922d06 (patch)
tree80162262fbb2b2729616d5a68d696bbad5bd3cde
parenta8af7fec323ca1a7796fc9587796095fe3dcc954 (diff)
downloadvcxsrv-46f5ae54c4a898002c80b2183ec8ed16dc922d06.tar.gz
vcxsrv-46f5ae54c4a898002c80b2183ec8ed16dc922d06.tar.bz2
vcxsrv-46f5ae54c4a898002c80b2183ec8ed16dc922d06.zip
Change in behaviour was causing xcalc to not resize properly anymore. Now the implementation is the same again as the previous version.
-rw-r--r--libxcb/src/xcb_conn.c28
1 files 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);