Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 8317 invoked from network); 9 Mar 2010 21:21:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Mar 2010 21:21:57 -0000 Received: (qmail 13852 invoked by uid 500); 9 Mar 2010 21:21:28 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 13787 invoked by uid 500); 9 Mar 2010 21:21:28 -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 13779 invoked by uid 99); 9 Mar 2010 21:21:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Mar 2010 21:21:28 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [188.40.99.202] (HELO eru.sfritsch.de) (188.40.99.202) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Mar 2010 21:21:21 +0000 Received: from [10.1.1.6] (helo=k.localnet) by eru.sfritsch.de with esmtp (Exim 4.69) (envelope-from ) id 1Np6rM-0008SA-OW for dev@httpd.apache.org; Tue, 09 Mar 2010 22:21:00 +0100 From: Stefan Fritsch To: dev@httpd.apache.org Subject: mod_reqtimeout and mod_proxy: how to distinguish incoming from backend connections Date: Tue, 9 Mar 2010 22:20:59 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.32-2-amd64; KDE/4.3.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201003092220.59538.sf@sfritsch.de> X-Virus-Checked: Checked by ClamAV on apache.org Hi, mod_proxy calls ap_run_pre_connection() on the backend connection, which causes mod_reqtimeout to be inserted as filter. This is of course wrong, because mod_reqtimeout will mess up mod_proxy's socket timeouts. After digging in the code I have found two potential solutions: - The scoreboard handle conn->sbh is always NULL in mod_proxy's backend connection. Mod_reqtimeout could use this to determine if it should do something. - mod_reqtimeout could hook into ap_run_process_connection with APR_HOOK_LAST or APR_HOOK_REALLY_LAST-1, i.e. right before ap_process_http_connection(). The hook function would then set a flag to activate mod_reqtimeout and then return DECLINED. This should lead to mod_reqtimeout only dealing with connections handled by ap_process_http_connection. Both approaches are rather hack-ish but I think the second one is a lot better than the first. It would also prevent mod_reqtimeout from influencing protocol handlers like mod_echo and mod_ftp. Does anyone have other ideas or comments? BTW, can someone create a mod_reqtimeout entry in bugzilla? Cheers, Stefan