You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2008/04/17 16:04:59 UTC

svn commit: r649114 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS support/ab.c

Author: jim
Date: Thu Apr 17 07:04:49 2008
New Revision: 649114

URL: http://svn.apache.org/viewvc?rev=649114&view=rev
Log:
Merge r617890 from trunk:

* Use a 64 bit unsigned int instead of a signed long to count the bytes
  transferred to avoid integer overflows.

PR: 44346

Submitted by: rpluem
Reviewed by: jim

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/support/ab.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=649114&r1=649113&r2=649114&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Thu Apr 17 07:04:49 2008
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.9
 
+  *) 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]
+
   *) ProxyPassReverse is now balancer aware. [Jim Jagielski]
 
   *) mod_include: Correctly handle SSI directives split over multiple filter

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=649114&r1=649113&r2=649114&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Thu Apr 17 07:04:49 2008
@@ -88,15 +88,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * ab: Use a 64 bit unsigned int instead of a signed long to count the
-   bytes transferred to avoid integer overflows
-   PR: 44346
-      Trunk version of patch:
-         http://svn.apache.org/viewvc?rev=617890&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-    +1: rpluem, jim, covener
-
  * ab: ab very poor performance with both -k and -i cmdline options specified
     PR34275
     Trunk version of patch:

Modified: httpd/httpd/branches/2.2.x/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/support/ab.c?rev=649114&r1=649113&r2=649114&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/ab.c (original)
+++ httpd/httpd/branches/2.2.x/support/ab.c Thu Apr 17 07:04:49 2008
@@ -300,9 +300,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 */
@@ -760,10 +760,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) {
@@ -1028,14 +1028,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 */