summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2017-10-10 11:09:22 +0200
committerYann Ylavic <ylavic@apache.org>2017-10-10 11:09:22 +0200
commit73faf3469d4dcefb832794de825c6951cfdbb0bc (patch)
treef79e2912a26c1cc4d361b2e3540725ebccd46a85 /support
parent* Make it compatible with Python 3 (diff)
downloadapache2-73faf3469d4dcefb832794de825c6951cfdbb0bc.tar.xz
apache2-73faf3469d4dcefb832794de825c6951cfdbb0bc.zip
ab: Keep reading nonblocking to exhaust TCP or SSL buffers when previous
read was incomplete (the SSL case can cause the next poll() to timeout since data are buffered already). PR 61301 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1811649 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support')
-rw-r--r--support/ab.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/support/ab.c b/support/ab.c
index 118e17b5c8..d8486ea769 100644
--- a/support/ab.c
+++ b/support/ab.c
@@ -1506,6 +1506,7 @@ static void read_connection(struct connection * c)
int i;
r = sizeof(buffer);
+read_more:
#ifdef USE_SSL
if (c->ssl) {
status = SSL_read(c->ssl, buffer, r);
@@ -1712,6 +1713,10 @@ static void read_connection(struct connection * c)
c->bread += r;
totalbread += r;
}
+ if (r == sizeof(buffer) && c->bread < c->length) {
+ /* read was full, try more immediately (nonblocking already) */
+ goto read_more;
+ }
if (c->keepalive && (c->bread >= c->length)) {
/* finished a keep-alive connection */