summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2013-05-09 13:09:02 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-10 09:02:57 +1000
commit67c66606c760c263d7a4c2d1bba43ed6225a4e7c (patch)
treeee68fc6b2dde9ecce772ed16827f53a44447c404
parentddc11397a56c745b5d1fb377e9d9b1fcc73802c8 (diff)
os: Reset input buffer's 'ignoreBytes' field
If a client sends a request larger than maxBigRequestSize, the server is supposed to ignore it. Before commit cf88363d, the server would simply disconnect the client. After that commit, it attempts to gracefully ignore the request by remembering how long the client specified the request to be, and ignoring that many bytes. However, if a client sends a BigReq header with a large size and disconnects before actually sending the rest of the specified request, the server will reuse the ConnectionInput buffer without resetting the ignoreBytes field. This makes the server ignore new X clients' requests. This fixes that behavior by resetting the ignoreBytes field when putting the ConnectionInput buffer back on the FreeInputs list. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--os/io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/os/io.c b/os/io.c
index 2f091c417..0d980ab9f 100644
--- a/os/io.c
+++ b/os/io.c
@@ -1063,6 +1063,7 @@ FreeOsBuffers(OsCommPtr oc)
oci->bufptr = oci->buffer;
oci->bufcnt = 0;
oci->lenLastReq = 0;
+ oci->ignoreBytes = 0;
}
}
if ((oco = oc->output)) {