Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5EF36CCC2 for ; Sun, 15 Sep 2013 02:25:54 +0000 (UTC) Received: (qmail 96324 invoked by uid 500); 15 Sep 2013 02:25:54 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 96279 invoked by uid 500); 15 Sep 2013 02:25:54 -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 96272 invoked by uid 99); 15 Sep 2013 02:25:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Sep 2013 02:25:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Sun, 15 Sep 2013 02:25:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C7CD523888E7; Sun, 15 Sep 2013 02:25:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1523387 - in /httpd/httpd/trunk: CHANGES server/mpm/winnt/child.c Date: Sun, 15 Sep 2013 02:25:32 -0000 To: cvs@httpd.apache.org From: covener@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130915022532.C7CD523888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: covener Date: Sun Sep 15 02:25:32 2013 New Revision: 1523387 URL: http://svn.apache.org/r1523387 Log: In 2.4, the MPM leaves a copy of the non-disconnected FD sitting in context->accept_socket. This FD will be closed a second time, often shortly after a worker picks it up in this same FD being reused. The first recv fails with WSAENOTSOCK since the same FD was closed in the listener thread while the worker was pulling it off the queue (The second close is of the underlying FD/socket, not a shared apr_socket_t, so it's not short-circuited) This patch makes it a bit more 2.2.x-ish and solves my problem -- the context->accept_socket gets zapped at the bottom of the loop if !disconnected. Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/server/mpm/winnt/child.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1523387&r1=1523386&r2=1523387&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Sun Sep 15 02:25:32 2013 @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) WinNT MPM: If ap_run_pre_connection() fails or sets c->aborted, don't + save the socket for reuse by the next worker as if it were an + APR_SO_DISCONNECTED socket. Restores 2.2 behavior. [Eric Covener] + *) mod_auth_digest: Be more specific when the realm mismatches because the realm has not been specified. [Graham Leggett] Modified: httpd/httpd/trunk/server/mpm/winnt/child.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=1523387&r1=1523386&r2=1523387&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/winnt/child.c (original) +++ httpd/httpd/trunk/server/mpm/winnt/child.c Sun Sep 15 02:25:32 2013 @@ -878,12 +878,13 @@ static DWORD __stdcall worker_main(void if (!c->aborted) { ap_run_process_connection(c); + } - apr_socket_opt_get(context->sock, APR_SO_DISCONNECTED, - &disconnected); + apr_socket_opt_get(context->sock, APR_SO_DISCONNECTED, &disconnected); - if (!disconnected) { - context->accept_socket = INVALID_SOCKET; + if (!disconnected) { + context->accept_socket = INVALID_SOCKET; + if (!c->aborted) { ap_lingering_close(c); } }