]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) ab: Fix a 100% CPU loop on platforms where a failed non-blocking connect
authorEric Covener <covener@apache.org>
Mon, 30 Mar 2009 02:19:02 +0000 (02:19 +0000)
committerEric Covener <covener@apache.org>
Mon, 30 Mar 2009 02:19:02 +0000 (02:19 +0000)
     returns EINPROGRESS and a subsequent poll() returns only POLLERR.
     Observed on HP-UX.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759832 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index fbee2a86f99dc0a3ffaaf2d5c65164a91b47d558..dc5ebc5cb86b46f6a269ec8bd888353edd3a57b3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.3.3
 
+  *) ab: Fix a 100% CPU loop on platforms where a failed non-blocking connect
+     returns EINPROGRESS and a subsequent poll() returns only POLLERR.
+     Observed on HP-UX.  [Eric Covener]
+
   *) Remove broken support for BeOS, OS/2, TPF, and even older platforms such
      as A/UX, Next, and Tandem.  [Jeff Trawick]
 
index 58b67a9658dadb92497d2257211d7d456df9b4de..5ce6861ae3c80774f53e1dd7f6fde468fadcaaa7 100644 (file)
@@ -1745,7 +1745,13 @@ static void test(void)
             if ((rv & APR_POLLERR) || (rv & APR_POLLNVAL)) {
                 bad++;
                 err_except++;
-                start_connect(c);
+                /* avoid apr_poll/EINPROGRESS loop on HP-UX, let recv discover ECONNREFUSED */
+                if (c->state == STATE_CONNECTING) { 
+                    read_connection(c);
+                }
+                else { 
+                    start_connect(c);
+                }
                 continue;
             }
             if (rv & APR_POLLOUT) {