summaryrefslogtreecommitdiff
path: root/os/osdep.h
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2010-08-27 10:20:29 -0700
committerKeith Packard <keithp@keithp.com>2010-09-10 11:48:17 -0700
commitcf88363db0ebb42df7cc286b85d30d7898aea840 (patch)
treecc869319ee714c64d173fc387db230ccc6bae63f /os/osdep.h
parentfa22f97af65efc2a147e9be0b7f288848965ff60 (diff)
os: Return BadLength instead of disconnecting BigReq clients (#4565)
If a client sends a big request that's too big (i.e. bigger than maxBigRequestSize << 2 bytes), the server just disconnects it. This makes the client receive SIGPIPE the next time it tries to send something. The X Test Suite sends requests that are too big when the test specifies the TOO_LONG test type. When the client receives SIGPIPE, XTS marks it as UNRESOLVED, which counts as a failure. Instead, remember how long the request is supposed to be and then return that size. Dispatch() checks the length and sends BadLength to the client. Then, whenever oci->ignoreBytes is nonzero, ignore the data read instead of trying to process it as a request. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os/osdep.h')
-rw-r--r--os/osdep.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/os/osdep.h b/os/osdep.h
index 1d87592e3..3c0e78f06 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -125,6 +125,7 @@ typedef struct _connectionInput {
int bufcnt; /* count of bytes in buffer */
int lenLastReq;
int size;
+ unsigned int ignoreBytes; /* bytes to ignore before the next request */
} ConnectionInput, *ConnectionInputPtr;
typedef struct _connectionOutput {