From: Jeff Trawick Date: Fri, 19 May 2000 02:18:06 +0000 (+0000) Subject: ab: Fix a command-line processing bug; track bad headers in X-Git-Tag: APACHE_2_0_ALPHA_4~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b31d97deda62ca034e4156876e80e577c50987cd;p=thirdparty%2Fapache%2Fhttpd.git ab: Fix a command-line processing bug; track bad headers in err_response; support reading headers up to 2K. (In the original patch it was 8K instead of 2K; it isn't clear to me that 8K is really needed or appropriate.) Submitted by: Ask Bjoern Hansen Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85251 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/ab.c b/support/ab.c index eb651f7dffe..8c6b53a6b19 100644 --- a/support/ab.c +++ b/support/ab.c @@ -82,7 +82,7 @@ ** - Cleaned up by Ralf S. Engelschall , March 1998 ** - POST and verbosity by Kurt Sussman , August 1998 ** - HTML table output added by David N. Welton , January 1999 - ** - Added Cookie, Arbitrary header and auth support. , April 199 + ** - Added Cookie, Arbitrary header and auth support. , April 1999 ** */ @@ -135,7 +135,7 @@ #define STATE_CONNECTING 1 #define STATE_READ 2 -#define CBUFFSIZE 512 +#define CBUFFSIZE 2048 struct connection { ap_socket_t *aprsock; @@ -143,7 +143,7 @@ struct connection { int read; /* amount of bytes read */ int bread; /* amount of body read */ int length; /* Content-Length value used for keep-alive */ - char cbuff[CBUFFSIZE]; /* a buffer to store server response header */ + char cbuff[CBUFFSIZE]; /* a buffer to store server response header */ int cbx; /* offset in cbuffer */ int keepalive; /* non-zero if a keep-alive request */ int gotheader; /* non-zero if we have the entire header in @@ -605,6 +605,7 @@ static void read_connection(struct connection *c) /* header is in invalid or too big - close connection */ ap_remove_poll_socket(readbits, c->aprsock); ap_close_socket(c->aprsock); + err_response++; if (bad++ > 10) { err("\nTest aborted after 10 failures\n\n"); } @@ -838,14 +839,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.14 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", VERSION " <$Revision: 1.15 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", VERSION, "$Revision: 1.14 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", VERSION, "$Revision: 1.15 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n"); @@ -1080,6 +1081,9 @@ int main(int argc, char **argv) case 'h': usage(argv[0]); break; + case 'V': + copyright(); + return 0; } }