Author: fielding
Date: Mon May 12 13:53:13 2008
New Revision: 655637
URL: http://svn.apache.org/viewvc?rev=655637&view=rev
Log:
Don't stop sending a request if EAGAIN is returned, which will only
happen if both the write and subsequent wait are returning EAGAIN,
and count posted bytes correctly when the initial write of a request
is not complete.
PR 10038, 38861, 39679
Submitted by: Patrick McManus <mcmanus datapower.com> (in 2003)
Stefan Fleiter <stefan.fleiter web.de> (in 2006)
and Davanum Srinivas (in 2006). Committed patch
contains parts of all three, tweaked by Roy (2008).
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=655637&r1=655636&r2=655637&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon May 12 13:53:13 2008
@@ -2,6 +2,14 @@
Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
+ *) ab: Don't stop sending a request if EAGAIN is returned, which
+ will only happen if both the write and subsequent wait are
+ returning EAGAIN, and count posted bytes correctly when the initial
+ write of a request is not complete. PR 10038, 38861, 39679
+ [Patrick McManus <mcmanus datapower.com>,
+ Stefan Fleiter <stefan.fleiter web.de>,
+ Davanum Srinivas, Roy T. Fielding]
+
*) ab: Overhaul stats collection and reporting to avoid integer
truncation and time divisions within the test loop, retain
native time resolution until output, remove unused data,
Modified: httpd/httpd/trunk/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=655637&r1=655636&r2=655637&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ab.c (original)
+++ httpd/httpd/trunk/support/ab.c Mon May 12 13:53:13 2008
@@ -627,8 +627,8 @@
if (c->rwrite == 0) {
apr_socket_timeout_set(c->aprsock, 0);
c->connect = tnow;
- c->rwrite = reqlen;
c->rwrote = 0;
+ c->rwrite = reqlen;
if (posting)
c->rwrite += postlen;
}
@@ -655,28 +655,17 @@
#endif
e = apr_socket_send(c->aprsock, request + c->rwrote, &l);
- /*
- * Bail early on the most common case
- */
- if (l == c->rwrite)
- break;
-
- if (e != APR_SUCCESS) {
- /*
- * Let's hope this traps EWOULDBLOCK too !
- */
- if (!APR_STATUS_IS_EAGAIN(e)) {
- epipe++;
- printf("Send request failed!\n");
- close_connection(c);
- }
+ if (e != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(e)) {
+ epipe++;
+ printf("Send request failed!\n");
+ close_connection(c);
return;
}
+ totalposted += l;
c->rwrote += l;
c->rwrite -= l;
- } while (1);
+ } while (c->rwrite);
- totalposted += c->rwrite;
c->state = STATE_READ;
c->endwrite = lasttime = apr_time_now();
{
|