httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r617890 - in /httpd/httpd/trunk: CHANGES support/ab.c
Date Sat, 02 Feb 2008 20:36:19 GMT
Author: rpluem
Date: Sat Feb  2 12:36:18 2008
New Revision: 617890

URL: http://svn.apache.org/viewvc?rev=617890&view=rev
Log:
* Use a 64 bit unsigned int instead of a signed long to count the bytes
  transferred to avoid integer overflows.

PR: 44346

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/support/ab.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=617890&r1=617889&r2=617890&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Feb  2 12:36:18 2008
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) ab: Use a 64 bit unsigned int instead of a signed long to count the
+     bytes transferred to avoid integer overflows. PR 44346 [Ruediger Pluem]
+
   *) mod_proxy_ajp: Do not retry request in the case that we either failed to
      sent a part of the request body or if the request is not idempotent.
      PR 44334 [Ruediger Pluem]

Modified: httpd/httpd/trunk/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=617890&r1=617889&r2=617890&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ab.c (original)
+++ httpd/httpd/trunk/support/ab.c Sat Feb  2 12:36:18 2008
@@ -306,9 +306,9 @@
 
 apr_size_t doclen = 0;      /* the length the document should be */
 long started = 0;           /* number of requests started, so no excess */
-long totalread = 0;         /* total number of bytes read */
-long totalbread = 0;        /* totoal amount of entity body read */
-long totalposted = 0;       /* total number of bytes posted, inc. headers */
+apr_uint64_t totalread = 0;         /* total number of bytes read */
+apr_uint64_t totalbread = 0;        /* totoal amount of entity body read */
+apr_uint64_t totalposted = 0;       /* total number of bytes posted, inc. headers */
 long done = 0;              /* number of requests we have done */
 long doneka = 0;            /* number of keep alive connections done */
 long good = 0, bad = 0;     /* number of good and bad requests */
@@ -773,10 +773,10 @@
         printf("Non-2xx responses:      %d\n", err_response);
     if (keepalive)
         printf("Keep-Alive requests:    %ld\n", doneka);
-    printf("Total transferred:      %ld bytes\n", totalread);
+    printf("Total transferred:      %" APR_UINT64_T_FMT " bytes\n", totalread);
     if (posting > 0)
-        printf("Total POSTed:           %ld\n", totalposted);
-    printf("HTML transferred:       %ld bytes\n", totalbread);
+        printf("Total POSTed:           %" APR_UINT64_T_FMT "\n", totalposted);
+    printf("HTML transferred:       %" APR_UINT64_T_FMT " bytes\n", totalbread);
 
     /* avoid divide by zero */
     if (timetaken) {
@@ -1045,14 +1045,14 @@
            "<td colspan=2 %s>%ld</td></tr>\n",
            trstring, tdstring, tdstring, doneka);
     printf("<tr %s><th colspan=2 %s>Total transferred:</th>"
-       "<td colspan=2 %s>%ld bytes</td></tr>\n",
+       "<td colspan=2 %s>%" APR_UINT64_T_FMT " bytes</td></tr>\n",
        trstring, tdstring, tdstring, totalread);
     if (posting > 0)
         printf("<tr %s><th colspan=2 %s>Total POSTed:</th>"
-           "<td colspan=2 %s>%ld</td></tr>\n",
+           "<td colspan=2 %s>%" APR_UINT64_T_FMT "</td></tr>\n",
            trstring, tdstring, tdstring, totalposted);
     printf("<tr %s><th colspan=2 %s>HTML transferred:</th>"
-       "<td colspan=2 %s>%ld bytes</td></tr>\n",
+       "<td colspan=2 %s>%" APR_UINT64_T_FMT " bytes</td></tr>\n",
        trstring, tdstring, tdstring, totalbread);
 
     /* avoid divide by zero */



Mime
View raw message