From: Jean-Jacques Clar Date: Fri, 19 Mar 2004 15:39:45 +0000 (+0000) Subject: Using ap_max() to ensure no negative values are stored in data structure. X-Git-Tag: pre_ajp_proxy~496 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec3144682b0b6b8cd869165f683bda018339c39d;p=thirdparty%2Fapache%2Fhttpd.git Using ap_max() to ensure no negative values are stored in data structure. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103035 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/ab.c b/support/ab.c index eff83b67e43..fac7b6a9d9a 100644 --- a/support/ab.c +++ b/support/ab.c @@ -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("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AP_AB_BASEREVISION, "$Revision: 1.141 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AP_AB_BASEREVISION, "$Revision: 1.142 $"); 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

\n");