Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 10060 invoked from network); 4 Oct 2009 16:23:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Oct 2009 16:23:55 -0000 Received: (qmail 29369 invoked by uid 500); 4 Oct 2009 16:23:54 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 29298 invoked by uid 500); 4 Oct 2009 16:23:54 -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 29289 invoked by uid 99); 4 Oct 2009 16:23:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2009 16:23:54 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 76.96.62.24 is neither permitted nor denied by domain of jim@jagunet.com) Received: from [76.96.62.24] (HELO QMTA02.westchester.pa.mail.comcast.net) (76.96.62.24) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2009 16:23:42 +0000 Received: from OMTA19.westchester.pa.mail.comcast.net ([76.96.62.98]) by QMTA02.westchester.pa.mail.comcast.net with comcast id og8m1c00327AodY52gPNtu; Sun, 04 Oct 2009 16:23:22 +0000 Received: from [192.168.199.10] ([69.251.84.64]) by OMTA19.westchester.pa.mail.comcast.net with comcast id ogV41c0091PGofZ3fgV4T0; Sun, 04 Oct 2009 16:29:05 +0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: svn commit: r821307 - in /httpd/httpd/trunk: include/scoreboard.h modules/experimental/mod_noloris.c server/scoreboard.c From: Jim Jagielski In-Reply-To: <4AC7AC07.9020609@apache.org> Date: Sun, 4 Oct 2009 12:23:20 -0400 Content-Transfer-Encoding: 7bit Message-Id: <6D006F5D-D4AB-4074-AA89-EF9EBEC7DCC3@jaguNET.com> References: <4AC7AC07.9020609@apache.org> To: dev@httpd.apache.org X-Mailer: Apple Mail (2.1076) X-Virus-Checked: Checked by ClamAV on apache.org On Oct 3, 2009, at 3:54 PM, Ruediger Pluem wrote: > > On 03.10.2009 14:54, jim@apache.org wrote: >> Author: jim >> Date: Sat Oct 3 12:54:35 2009 >> New Revision: 821307 >> >> URL: http://svn.apache.org/viewvc?rev=821307&view=rev >> Log: >> Provide new ap_update_child_status_from_conn() mostly >> for use with mod_noloris.c Add some logic protection, for >> NULL ref, which shoulda be there in any case. >> >> Modified: >> httpd/httpd/trunk/include/scoreboard.h >> httpd/httpd/trunk/modules/experimental/mod_noloris.c >> httpd/httpd/trunk/server/scoreboard.c >> > >> Modified: httpd/httpd/trunk/modules/experimental/mod_noloris.c >> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/experimental/mod_noloris.c?rev=821307&r1=821306&r2=821307&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- httpd/httpd/trunk/modules/experimental/mod_noloris.c (original) >> +++ httpd/httpd/trunk/modules/experimental/mod_noloris.c Sat Oct 3 >> 12:54:35 2009 >> @@ -57,17 +57,9 @@ >> >> static int noloris_conn(conn_rec *conn) >> { >> - /*** FIXME >> - * This is evil: we're assuming info that's private to the >> scoreboard >> - * We need to do that because there's no API to update the >> scoreboard >> - * on a connection, only with a request (or NULL to say not >> processing >> - * any request). We need a version of ap_update_child_status >> that >> - * accepts a conn_rec. >> - */ >> struct { int child_num; int thread_num; } *sbh = conn->sbh; > > Hm. Shouldn't we remove the line above as well now that the comment > is gone? > >> >> char *shm_rec; >> - worker_score *ws; >> if (shm == NULL) { >> return DECLINED; /* we're disabled */ >> } > >> Modified: httpd/httpd/trunk/server/scoreboard.c >> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?rev=821307&r1=821306&r2=821307&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- httpd/httpd/trunk/server/scoreboard.c (original) >> +++ httpd/httpd/trunk/server/scoreboard.c Sat Oct 3 12:54:35 2009 >> @@ -490,6 +492,19 @@ >> status, r); >> } >> >> +AP_DECLARE(int) ap_update_child_status_from_conn(ap_sb_handle_t >> *sbh, int status, >> + conn_rec *c) >> +{ >> + if (!sbh) >> + return -1; >> + >> + request_rec fake_rec; >> + fake_rec.connection = c; > > Shouldn't we set fake_rec.per_dir_config and fake_rec.server to NULL > to play safe? > No because if you follow the code, a null fake_rec.per_dir_config is handled correctly as is a null server. The only one that wasn't was the one that required the change to the double-possible NULL.