From: Jim Jagielski Date: Thu, 17 Apr 2008 14:04:49 +0000 (+0000) Subject: Merge r617890 from trunk: X-Git-Tag: 2.2.9~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3f39c1b9a05a6bae21cd37cc89f6350a5e960ea;p=thirdparty%2Fapache%2Fhttpd.git 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@649114 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index eb13ec3fe2f..3c44a87cba3 100644 --- a/CHANGES +++ b/CHANGES @@ -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 diff --git a/STATUS b/STATUS index 9f5811f2764..9434ae33348 100644 --- a/STATUS +++ b/STATUS @@ -88,15 +88,6 @@ RELEASE SHOWSTOPPERS: 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: diff --git a/support/ab.c b/support/ab.c index 5adf5a5b1aa..fb191e54a20 100644 --- a/support/ab.c +++ b/support/ab.c @@ -300,9 +300,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 */ @@ -760,10 +760,10 @@ static void output_results(void) 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 @@ static void output_html_results(void) "%ld\n", trstring, tdstring, tdstring, doneka); printf("Total transferred:" - "%ld bytes\n", + "%" APR_UINT64_T_FMT " bytes\n", trstring, tdstring, tdstring, totalread); if (posting > 0) printf("Total POSTed:" - "%ld\n", + "%" APR_UINT64_T_FMT "\n", trstring, tdstring, tdstring, totalposted); printf("HTML transferred:" - "%ld bytes\n", + "%" APR_UINT64_T_FMT " bytes\n", trstring, tdstring, tdstring, totalbread); /* avoid divide by zero */