You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2017/10/10 09:09:22 UTC

svn commit: r1811649 - in /httpd/httpd/trunk: CHANGES support/ab.c

Author: ylavic
Date: Tue Oct 10 09:09:22 2017
New Revision: 1811649

URL: http://svn.apache.org/viewvc?rev=1811649&view=rev
Log:
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


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=1811649&r1=1811648&r2=1811649&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Oct 10 09:09:22 2017
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) 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 [Luca Toscano, Yann Ylavic]
+
   *) mod_md: v0.9.9, fix for applying challenge type based on available ports. [Stefan Eissing]
 
   *) mod_proxy_uwsgi: New UWSGI mod_proxy (sub)module contributed by unbit.com.

Modified: httpd/httpd/trunk/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=1811649&r1=1811648&r2=1811649&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ab.c (original)
+++ httpd/httpd/trunk/support/ab.c Tue Oct 10 09:09:22 2017
@@ -1506,6 +1506,7 @@ static void read_connection(struct conne
     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 conne
         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 */