Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 94292 invoked from network); 16 Dec 2006 21:42:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Dec 2006 21:42:27 -0000 Received: (qmail 85370 invoked by uid 500); 16 Dec 2006 21:42:35 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 85300 invoked by uid 500); 16 Dec 2006 21:42:34 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 85289 invoked by uid 99); 16 Dec 2006 21:42:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Dec 2006 13:42:34 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Dec 2006 13:42:26 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 714A71A981A; Sat, 16 Dec 2006 13:41:39 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r487901 - in /httpd/httpd/trunk: CHANGES server/listen.c Date: Sat, 16 Dec 2006 21:41:39 -0000 To: cvs@httpd.apache.org From: niq@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061216214139.714A71A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: niq Date: Sat Dec 16 13:41:38 2006 New Revision: 487901 URL: http://svn.apache.org/viewvc?view=rev&rev=487901 Log: PR#37680: fix socket block/nonblock on restart/graceful Patch submitted by Darius Davis (darius-abz free-range.com.au) Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/server/listen.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=487901&r1=487900&r2=487901 ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Sat Dec 16 13:41:38 2006 @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) core: Fix NONBLOCK status of listening sockets on restart/graceful + [Darius Davis ] + *) mod_proxy_http: Handle request bodies larger than 2 GB by converting the Content-Length header of the request correctly. PR 40883. [Ruediger Pluem, toadie ] Modified: httpd/httpd/trunk/server/listen.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/listen.c?view=diff&rev=487901&r1=487900&r2=487901 ============================================================================== --- httpd/httpd/trunk/server/listen.c (original) +++ httpd/httpd/trunk/server/listen.c Sat Dec 16 13:41:38 2006 @@ -361,6 +361,9 @@ int num_open; const char *userdata_key = "ap_open_listeners"; void *data; +#if AP_NONBLOCK_WHEN_MULTI_LISTEN + int use_nonblock; +#endif /* Don't allocate a default listener. If we need to listen to a * port, then the user needs to have a Listen directive in their @@ -476,16 +479,15 @@ * is already forgotten about by the time we call accept, we won't * be hung until another connection arrives on that port */ - if (ap_listeners && ap_listeners->next) { - for (lr = ap_listeners; lr; lr = lr->next) { - apr_status_t status; - - status = apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1); - if (status != APR_SUCCESS) { - ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, status, pool, - "unable to make listening socket non-blocking"); - return -1; - } + use_nonblock = (ap_listeners && ap_listeners->next); + for (lr = ap_listeners; lr; lr = lr->next) { + apr_status_t status; + + status = apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, use_nonblock); + if (status != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, status, pool, + "unable to control socket non-blocking status"); + return -1; } } #endif /* AP_NONBLOCK_WHEN_MULTI_LISTEN */