From ad7f5c3829107caf7deddaa459b99080cc1c056b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 15 Jan 2014 11:43:26 +0100 Subject: MINOR: add support for 'R={0|1}' to send random data This is useful for testing compression. --- httpterm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/httpterm.c b/httpterm.c index 5e86912..0cb31fc 100644 --- a/httpterm.c +++ b/httpterm.c @@ -453,6 +453,7 @@ struct session { int req_cache, req_time; int req_chunked; int req_nosplice; + int req_random; }; struct listener { @@ -592,6 +593,8 @@ static fd_set *PrevReadEvent = NULL, *PrevWriteEvent = NULL; static char trash[BUFSIZE]; static char common_response[RESPSIZE]; static char common_chunk_resp[RESPSIZE]; +static char *random_resp; +static int random_resp_len = RESPSIZE; const int zero = 0; const int one = 1; @@ -680,6 +683,8 @@ const char *HTTP_HELP = " Enable transfer enconding chunked with 1 byte chunks\n" "
  • /?S={0|1} :\n" " Disable/enable use of splice() to send data\n" + "
  • /?R={0|1} :\n" + " Disable/enable sending random data (disables splicing)\n" "\n" "Note that those arguments may be cumulated on one line separated by\n" " the '&' sign :