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 692C9D47F for ; Thu, 9 Aug 2012 19:53:12 +0000 (UTC) Received: (qmail 60214 invoked by uid 500); 9 Aug 2012 19:53:11 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 59947 invoked by uid 500); 9 Aug 2012 19:53:11 -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 59937 invoked by uid 99); 9 Aug 2012 19:53:11 -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 19:53:11 +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.220.173 as permitted sender) Received: from [209.85.220.173] (HELO mail-vc0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 19:53:05 +0000 Received: by vcbfl15 with SMTP id fl15so1015201vcb.18 for ; Thu, 09 Aug 2012 12:52:44 -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=cGm+GqgvUU0U3b1uSCONa9MYT9dtEi43n7nlgf/BOCM=; b=rWNJa4ENmIOp/elgPz9VeQTOIJcJBNEjVjsLQP6NhDEAYB80Fgrug91koriVFkwX1N HBYZSYwSiI3QgV87gF6I7tQsbjrcpKjkaajWEC2oUwFRYvD/Ma3B/0O8vdm18mtNzpJY pc45i2ojiXE6ev0ok1kh9YmgWiP2IaOhlsQQUkhhEe4uHZyld3GEZ1UikWT9F43dXUUH f7KxiIC6UPsF+CZRbdqyH0N5K1Vr4wna6OdJ/3Tp7XYxtU/Ft58GSoSxIDafqMWTAnqL hZsKYPiah9jHwFoPILs50nUCI7dI6dMy/JuzNLsZYV7q+UneeGk4L0UUwA4kohi4Obqg W7qA== MIME-Version: 1.0 Received: by 10.52.66.112 with SMTP id e16mr290693vdt.121.1344541964403; Thu, 09 Aug 2012 12:52:44 -0700 (PDT) Received: by 10.220.157.71 with HTTP; Thu, 9 Aug 2012 12:52:44 -0700 (PDT) In-Reply-To: References: <31f247cbaff240b7a06a2c3713fb8a96@BY2PR03MB608.namprd03.prod.outlook.com> Date: Thu, 9 Aug 2012 15:52:44 -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 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 he= ap > 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 processe= d > correctly in windows version of httpd. It may be related to the fact that > 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); > > > > > > Please advise on what the next step(s) should be. > > > > Thanks > > Claudio > > --=20 Born in Roswell... married an alien... http://emptyhammock.com/