]> granicus.if.org Git - apache/commitdiff
Fix the long-standing bug that "ab -t10" would loop for 10000 seconds
authorMartin Kraemer <martin@apache.org>
Tue, 16 Jul 2002 09:28:40 +0000 (09:28 +0000)
committerMartin Kraemer <martin@apache.org>
Tue, 16 Jul 2002 09:28:40 +0000 (09:28 +0000)
instead of 10 as documented. Also fix an off-by-one-second error, which
did not matter much (in comparison to the 1000x error ;-)

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

support/ab.c

index 3849d3c1949888170bdb8c74276b1e2bf95138a8..df19f00a25185896df24de01c2ecd823a65b78a9 100644 (file)
@@ -278,7 +278,7 @@ int heartbeatres = 100;             /* How often do we say we're alive */
 int concurrency = 1;           /* Number of multiple requests to make */
 int percentile = 1;            /* Show percentile served */
 int confidence = 1;            /* Show confidence estimator and warnings */
-int tlimit = 0;                        /* time limit in cs */
+int tlimit = 0;                        /* time limit in secs */
 int keepalive = 0;             /* try and do keepalive connections */
 char servername[1024];         /* name that server reports */
 char *hostname;                        /* host name from URL */
@@ -1639,8 +1639,9 @@ static void test(void)
        /* check for time limit expiry */
        now = apr_time_now();
        timed = (apr_int32_t)apr_time_sec(now - start);
-       if (tlimit && timed > (tlimit * 1000)) {
+       if (tlimit && timed >= tlimit) {
            requests = done;    /* so stats are correct */
+           break;              /* no need to do another round */
        }
 
        n = concurrency;
@@ -1726,14 +1727,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.111 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.112 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2002 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_AB_BASEREVISION, "$Revision: 1.111 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.112 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");