Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A98CAD2BA for ; Thu, 9 Aug 2012 20:29:17 +0000 (UTC) Received: (qmail 15563 invoked by uid 500); 9 Aug 2012 20:29:16 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 15499 invoked by uid 500); 9 Aug 2012 20:29:16 -0000 Mailing-List: contact dev-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 dev@httpd.apache.org Received: (qmail 15491 invoked by uid 99); 9 Aug 2012 20:29:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 20:29:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of trawick@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 20:29:10 +0000 Received: by vbip1 with SMTP id p1so1037535vbi.18 for ; Thu, 09 Aug 2012 13:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=JXOGRysXRTCb3WFuT67UfVaVhMMxGccexNcgnHw+YW0=; b=02VNCxtdzug48JhtUxyGlIfW16vCc8qtcXms2ZpdOvW+CQcpKUkyx1/n0ciJ/Q/rgt ga//e3LnD7t9m4+w7MgT0IHxlX9brP2kJsbG9ynStv2/riOIn+VK6HOkkfMfxqeStDF/ IMrHFA+fSnYBE1Y2Ke+mInzD5bRpegev2OqzuNiDXEK9GwSzL69U01e3W+XDjhg9e6A+ FiMhMfmlA7G9H5YSZCh7NDOZYw5sCaUthKeBgVArHRCa9OzWxs6u4Z9w6uwSDa0qEap0 EcT+0Oq+nfRN2/R59el4IPUJSvB8Pnw+WibvmmQgtZfKwmUo/ppUCJByPepWkNJuCMwg PhdA== MIME-Version: 1.0 Received: by 10.52.176.195 with SMTP id ck3mr392742vdc.92.1344544129495; Thu, 09 Aug 2012 13:28:49 -0700 (PDT) Received: by 10.220.157.71 with HTTP; Thu, 9 Aug 2012 13:28:49 -0700 (PDT) In-Reply-To: References: <31f247cbaff240b7a06a2c3713fb8a96@BY2PR03MB608.namprd03.prod.outlook.com> Date: Thu, 9 Aug 2012 16:28:49 -0400 Message-ID: Subject: Re: Fix for Windows bug#52476 From: Jeff Trawick To: dev@httpd.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Thu, Aug 9, 2012 at 3:52 PM, Jeff Trawick wrote: > On Thu, Aug 9, 2012 at 2:26 PM, Claudio Caldato (MS OPEN TECH) > wrote: >> Better patch, fixed minor issue after another code review. > > I tested and seemed to get good results, but my testing isn't > reproducible enough with/without various patches to be conclusive. > > A couple of comments on the patch itself: > > * Why is BytesRead initialized to 0 in the other function? (I didn't > include that part of your patch in my test.) > * Pass apr_get_netos_error() to ap_log_error instead of rc after a > Winsock function like recv() fails. (apr_get_os_error() otherwise) > > More comments below: > > >> Thanks >> >> Claudio > >> From: Claudio Caldato (MS OPEN TECH) [mailto:claudioc@microsoft.com] >> Sent: Thursday, August 9, 2012 11:13 AM >> To: dev@httpd.apache.org >> Subject: Fix for Windows bug#52476 >> >> >> >> Please code review the fix and let me know if you find any issue. >> >> >> >> Attached is the proposed patch for >> >> server\mpm\winnt\child.c >> >> >> >> Summary for code reviewers: >> >> If AcceptFilter is =91connect=92 or =91none=92, we read data from socket= on worker >> thread. We use blocking recv and assign context->overlapped.Pointer to h= eap >> allocated buffer. It is the same procedure as in case of =91AcceptFilter >> data=92, but done in worker thread to keep listen thread unblocked. > > The big picture doesn't seem correct. The main path of httpd (that > stuff called via ap_run_process_connection()) needs to be able to read > at will. It shouldn't help to move a read() to before the call to > ap_run_process_connection(). > > >> Note: >> >> It looks like context with overlapped.Pointer =3D=3D NULL is not process= ed >> correctly in windows version of httpd. It may be related to the fact tha= t >> winnt_insert_network_bucket() rejects context records with >> overlapped.Pointer =3D=3D NULL > > Uhh, maybe I'm confused but that sounds like the issue! (I'm not > familiar with that hook.) > > What about this patch? > > Index: server/mpm/winnt/child.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- server/mpm/winnt/child.c (revision 1371377) > +++ server/mpm/winnt/child.c (working copy) > @@ -780,11 +780,15 @@ > apr_bucket *e; > winnt_conn_ctx_t *context =3D ap_get_module_config(c->conn_config, > &mpm_winnt_module); > - if (context =3D=3D NULL || (e =3D context->overlapped.Pointer) =3D= =3D NULL) > + if (context =3D=3D NULL) { > return AP_DECLINED; > + } > > - /* seed the brigade with AcceptEx read heap bucket */ > - APR_BRIGADE_INSERT_HEAD(bb, e); > + if ((e =3D context->overlapped.Pointer) !=3D NULL) { > + /* seed the brigade with AcceptEx read heap bucket */ > + APR_BRIGADE_INSERT_HEAD(bb, e); > + } > + > /* also seed the brigade with the client socket. */ > e =3D apr_bucket_socket_create(socket, c->bucket_alloc); > APR_BRIGADE_INSERT_TAIL(bb, e); no, that's wrong you only need to put the socket bucket there if you need to put data in front of it; (when declining, core's insert_network_bucket hook will do the right thing with the socket) AFAICT there's no functional issue with winnt_insert_network_bucket, though it could defer to core to handle the socket bucket > >> >> >> >> >> >> Please advise on what the next step(s) should be. >> >> >> >> Thanks >> >> Claudio >> >> > > > > -- > Born in Roswell... married an alien... > http://emptyhammock.com/ --=20 Born in Roswell... married an alien... http://emptyhammock.com/