]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
ab: Fix a command-line processing bug; track bad headers in
authorJeff Trawick <trawick@apache.org>
Fri, 19 May 2000 02:18:06 +0000 (02:18 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 19 May 2000 02:18:06 +0000 (02:18 +0000)
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 <ask@valueclick.com>
Reviewed by: Jeff Trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85251 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index eb651f7dffe4121abe8a642b87fe4b2b6b0ed938..8c6b53a6b190e440192d2522d67f510d9049fc5d 100644 (file)
@@ -82,7 +82,7 @@
    **    - Cleaned up by Ralf S. Engelschall <rse@apache.org>, March 1998
    **    - POST and verbosity by Kurt Sussman <kls@merlot.com>, August 1998
    **    - HTML table output added by David N. Welton <davidw@prosa.it>, January 1999
-   **    - Added Cookie, Arbitrary header and auth support. <dirkx@webweaving.org>, April 199
+   **    - Added Cookie, Arbitrary header and auth support. <dirkx@webweaving.org>, April 1999
    **
  */
 
 #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("<p>\n");
-        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", VERSION, "$Revision: 1.14 $");
+        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", VERSION, "$Revision: 1.15 $");
         printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
         printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
         printf("</p>\n<p>\n");
@@ -1080,6 +1081,9 @@ int main(int argc, char **argv)
        case 'h':
            usage(argv[0]);
            break;
+       case 'V':
+           copyright();
+           return 0;
         }
     }