From: Willy Tarreau Date: Sat, 12 Nov 2016 17:25:45 +0000 (+0100) Subject: CONTRIB: tcploop: support sending plain strings X-Git-Tag: v1.7.0~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59623e0aa841f4d7a94d8d671e27183df8205922;p=thirdparty%2Fhaproxy.git CONTRIB: tcploop: support sending plain strings By passing "S:" instead of S it's possible to send a pre-defined string, which is convenient to write HTTP requests or responses. Example : produce two responses, one in keep-alive, one not for ab : ./tcploop 8001 L W N2 A R S:"HTTP/1.0 200 OK\r\nConnection: keep-alive\r\nContent-length: 50\r\n\r\n0123456789.123456789.123456789.123456789.123456789" R S:"HTTP/1.0 200 OK\r\nContent-length: 50\r\n\r\n0123456789.123456789.123456789.123456789.123456789" With 20 such keep-alive responses and 10 parallel processes, ab achieves 350kreq/s, so it should be possible to get precise timings. --- diff --git a/contrib/tcploop/tcploop.c b/contrib/tcploop/tcploop.c index 5dfc3aee75..8b9a0a0a70 100644 --- a/contrib/tcploop/tcploop.c +++ b/contrib/tcploop/tcploop.c @@ -102,6 +102,7 @@ __attribute__((noreturn)) void usage(int code, const char *arg0) " Q : disable TCP Quick-ack\n" " R[] : Read this amount of bytes. 0=infinite. unset=any amount.\n" " S[] : Send this amount of bytes. 0=infinite. unset=any amount.\n" + " S: : Send this exact string. \\r, \\n, \\t, \\\\ supported.\n" " E[] : Echo this amount of bytes. 0=infinite. unset=any amount.\n" " W[