summaryrefslogtreecommitdiff
path: root/xserver/os/io.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-21 20:10:50 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-21 20:10:50 +0000
commit239364510e41b034ad6ecb6cb51120232e7166cc (patch)
tree37c3c57c97d3fda8179a0204d94318a738309cc0 /xserver/os/io.c
parent9c0c4e62648084518b26f71ef3e5664454486b42 (diff)
Update to xorg-server 1.9.3. Tested by japser@, landry@ and ajacoutot@
in various configurations.
Diffstat (limited to 'xserver/os/io.c')
-rw-r--r--xserver/os/io.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/xserver/os/io.c b/xserver/os/io.c
index fb9f76207..421023807 100644
--- a/xserver/os/io.c
+++ b/xserver/os/io.c
@@ -410,16 +410,29 @@ ReadRequestFromClient(ClientPtr client)
else
needed = sizeof(xReq);
}
- oci->lenLastReq = needed;
/* If there are bytes to ignore, ignore them now. */
if (oci->ignoreBytes > 0) {
assert(needed == oci->ignoreBytes || needed == oci->size);
- oci->ignoreBytes -= gotnow;
- needed = gotnow = 0;
+ /*
+ * The _XSERVTransRead call above may return more or fewer bytes than we
+ * want to ignore. Ignore the smaller of the two sizes.
+ */
+ if (gotnow < needed) {
+ oci->ignoreBytes -= gotnow;
+ oci->bufptr += gotnow;
+ gotnow = 0;
+ } else {
+ oci->ignoreBytes -= needed;
+ oci->bufptr += needed;
+ gotnow -= needed;
+ }
+ needed = 0;
}
+ oci->lenLastReq = needed;
+
/*
* Check to see if client has at least one whole request in the
* buffer beyond the request we're returning to the caller.