]> granicus.if.org Git - apache/commitdiff
Fixed segfault in "-i" mode of ab
authorBrian Pane <brianp@apache.org>
Sun, 27 Jan 2002 06:38:25 +0000 (06:38 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 27 Jan 2002 06:38:25 +0000 (06:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93043 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index 0322d1795736f28ca7eaa6f3f41820e1284a3a24..bd84d0c4b26987080393a5432221b268ed31bb0d 100644 (file)
@@ -1146,7 +1146,7 @@ static void test(void)
     apr_poll_setup(&readbits, concurrency, cntxt);
 
     /* setup request */
-    if (!posting) {
+    if (posting <= 0) {
        sprintf(request, "%s %s HTTP/1.0\r\n"
                "User-Agent: ApacheBench/%s\r\n"
                "%s" "%s" "%s"
@@ -1185,7 +1185,7 @@ static void test(void)
     /*
      * Combine headers and (optional) post file into one contineous buffer
      */
-    if (posting) {
+    if (posting == 1) {
        char *buff = (char *) malloc(postlen + reqlen + 1);
        strcpy(buff, request);
        strcpy(buff + reqlen, postdata);
@@ -1302,14 +1302,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_SERVER_BASEREVISION " <$Revision: 1.86 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_SERVER_BASEREVISION " <$Revision: 1.87 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2001 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", AP_SERVER_BASEREVISION, "$Revision: 1.86 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_SERVER_BASEREVISION, "$Revision: 1.87 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2001 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");