]> granicus.if.org Git - apache/commitdiff
Using ap_max() to ensure no negative values are stored in data structure.
authorJean-Jacques Clar <clar@apache.org>
Fri, 19 Mar 2004 15:39:45 +0000 (15:39 +0000)
committerJean-Jacques Clar <clar@apache.org>
Fri, 19 Mar 2004 15:39:45 +0000 (15:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103035 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index eff83b67e4322132c7ea196d992d33f48d714d3b..fac7b6a9d9a3c7bf592046d2b25a5b914e022dce 100644 (file)
@@ -1287,9 +1287,9 @@ static void close_connection(struct connection * c)
            c->done = apr_time_now();
            s.read = c->read;
            s.starttime = c->start;
-           s.ctime = (c->connect - c->start) / 1000;
-           s.time = (c->done - c->start) / 1000;
-           s.waittime = (c->beginread - c->endwrite) / 1000;
+           s.ctime = ap_max(0, (c->connect - c->start) / 1000);
+           s.time = ap_max(0, (c->done - c->start) / 1000);
+           s.waittime = ap_max(0, (c->beginread - c->endwrite) / 1000);
            stats[done++] = s;
        }
     }
@@ -1508,9 +1508,9 @@ static void read_connection(struct connection * c)
            c->done = apr_time_now();
            s.read = c->read;
            s.starttime = c->start;
-           s.ctime = (c->connect - c->start) / 1000;
-           s.waittime = (c->beginread - c->endwrite) / 1000;
-           s.time = (c->done - c->start) / 1000;
+           s.ctime = ap_max(0, (c->connect - c->start) / 1000);
+           s.waittime = ap_max(0, (c->beginread - c->endwrite) / 1000);
+           s.time = ap_max(0, (c->done - c->start) / 1000);
            stats[done++] = s;
        }
        c->keepalive = 0;
@@ -1786,14 +1786,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.141 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.142 $> 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.141 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.142 $");
        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");