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,
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;
}
#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();
{