server will NOT wait for the full request body to get sent
idle do nothing after receiving the request, just "sit idle"
stream continuously send data to the client, never-ending
+writedelay: [secs] delay this amount between reply packets
pipe: [num] tell the server to expect this many HTTP requests before
sending back anything, to allow pipelining tests
skip: [num] instructs the server to ignore reading this many bytes from a PUT
HTTP/1.1 416 Requested Range Not Satisfiable\r
Date: Thu, 09 Sep 2010 14:49:00 GMT\r
Accept-Ranges: bytes\r
-Content-Length: 6\r
+Content-Length: 115\r
\r
-Error
+This is a long error message that is large enough that the test server is
+guaranteed to split it into two packets.
</data>
<data1>
\r
partial body
</data1>
+
+<servercmd>
+writedelay: 1
+</servercmd>
</reply>
# Client-side
HTTP/1.1 416 Requested Range Not Satisfiable\r
Date: Thu, 09 Sep 2010 14:49:00 GMT\r
Accept-Ranges: bytes\r
-Content-Length: 6\r
+Content-Length: 115\r
\r
+This is a long error message that is large enough that the test server is
+guaranteed to split it into two packets.
HTTP/1.1 206 Partial Content\r
Date: Thu, 09 Sep 2010 14:49:01 GMT\r
Accept-Ranges: bytes\r
size_t cl; /* Content-Length of the incoming request */
bool digest; /* Authorization digest header found */
bool ntlm; /* Authorization ntlm header found */
+ int writedelay; /* if non-zero, delay this number of seconds between
+ writes in the response */
int pipe; /* if non-zero, expect this many requests to do a "piped"
request/response */
int skip; /* if non-zero, the server is instructed to not read this
logmsg("instructed to skip this number of bytes %d", num);
req->skip = num;
}
+ else if(1 == sscanf(cmd, "writedelay: %d", &num)) {
+ logmsg("instructed to delay %d secs between packets", num);
+ req->writedelay = num;
+ }
else {
logmsg("funny instruction found: %s", cmd);
}
req->ntlm = FALSE;
req->pipe = 0;
req->skip = 0;
+ req->writedelay = 0;
req->rcmd = RCMD_NORMALREQ;
req->prot_version = 0;
req->pipelining = FALSE;
else {
logmsg("Sent off %zd bytes", written);
}
+ if (req->writedelay) {
+ logmsg("Pausing %d seconds", req->writedelay);
+ sleep(req->writedelay);
+ }
/* write to file as well */
fwrite(buffer, 1, (size_t)written, dump);
if(got_exit_signal)