Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 83085 invoked from network); 12 Dec 2008 16:08:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2008 16:08:38 -0000 Received: (qmail 4481 invoked by uid 500); 12 Dec 2008 16:08:50 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 4243 invoked by uid 500); 12 Dec 2008 16:08:50 -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 4234 invoked by uid 99); 12 Dec 2008 16:08:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 08:08:50 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 16:08:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B4CC223888A4; Fri, 12 Dec 2008 08:08:16 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r726065 - /httpd/httpd/trunk/server/mpm_common.c Date: Fri, 12 Dec 2008 16:08:16 -0000 To: cvs@httpd.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081212160816.B4CC223888A4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jorton Date: Fri Dec 12 08:08:16 2008 New Revision: 726065 URL: http://svn.apache.org/viewvc?rev=726065&view=rev Log: * server/mpm_common.c (dummy_connection): If possible, use a non-SSL listening port to use for the dummy connection, to avoid causing (confusing) error log spam by sending EOF down an SSL port. PR: 39653 Modified: httpd/httpd/trunk/server/mpm_common.c Modified: httpd/httpd/trunk/server/mpm_common.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?rev=726065&r1=726064&r2=726065&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm_common.c (original) +++ httpd/httpd/trunk/server/mpm_common.c Fri Dec 12 08:08:16 2008 @@ -657,6 +657,7 @@ apr_socket_t *sock; apr_pool_t *p; apr_size_t len; + ap_listen_rec *lp; /* create a temporary pool for the socket. pconf stays around too long */ rv = apr_pool_create(&p, pod->p); @@ -664,8 +665,19 @@ return rv; } - rv = apr_socket_create(&sock, ap_listeners->bind_addr->family, - SOCK_STREAM, 0, p); + /* If possible, find a listener which is configured for + * plain-HTTP, not SSL; using an SSL port would either be + * expensive to do correctly (performing a complete SSL handshake) + * or cause log spam by doing incorrectly (simply sending EOF). */ + lp = ap_listeners; + while (lp && lp->protocol && strcasecmp(lp->protocol, "http") != 0) { + lp = lp->next; + } + if (!lp) { + lp = ap_listeners; + } + + rv = apr_socket_create(&sock, lp->bind_addr->family, SOCK_STREAM, 0, p); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "get socket to connect to listener"); @@ -688,7 +700,7 @@ return rv; } - rv = apr_socket_connect(sock, ap_listeners->bind_addr); + rv = apr_socket_connect(sock, lp->bind_addr); if (rv != APR_SUCCESS) { int log_level = APLOG_WARNING; @@ -701,7 +713,7 @@ } ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf, - "connect to listener on %pI", ap_listeners->bind_addr); + "connect to listener on %pI", lp->bind_addr); } /* Create the request string. We include a User-Agent so that