From: Eric Covener Date: Mon, 30 Mar 2009 02:19:02 +0000 (+0000) Subject: *) ab: Fix a 100% CPU loop on platforms where a failed non-blocking connect X-Git-Tag: 2.3.3~755 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5924705197c4ebc86ccf73374ffd33df06b1fec9;p=thirdparty%2Fapache%2Fhttpd.git *) 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759832 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index fbee2a86f99..dc5ebc5cb86 100644 --- 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] diff --git a/support/ab.c b/support/ab.c index 58b67a9658d..5ce6861ae3c 100644 --- a/support/ab.c +++ b/support/ab.c @@ -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) {