]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Use a 64 bit unsigned int instead of a signed long to count the bytes
authorRuediger Pluem <rpluem@apache.org>
Sat, 2 Feb 2008 20:36:18 +0000 (20:36 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sat, 2 Feb 2008 20:36:18 +0000 (20:36 +0000)
  transferred to avoid integer overflows.

PR: 44346

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

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index bc28dce7ca9a8a3db00a97411084b447a571ea47..590029ac8e8e62b93f334dce421f123169363c20 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
index 46040af0d4958b909e6c02f640f9d550f7497edf..37ddbd9d6fe105042bf8611b33fa53274f12433c 100644 (file)
@@ -306,9 +306,9 @@ const char *tdstring;
 
 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 @@ static void output_results(int sig)
         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 @@ static void output_html_results(void)
            "<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 */