Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 96711 invoked from network); 30 Nov 2008 23:23:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Nov 2008 23:23:15 -0000 Received: (qmail 28694 invoked by uid 500); 30 Nov 2008 23:23:20 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 28629 invoked by uid 500); 30 Nov 2008 23:23:20 -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 28620 invoked by uid 99); 30 Nov 2008 23:23:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Nov 2008 15:23:20 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of covener@gmail.com designates 74.125.44.156 as permitted sender) Received: from [74.125.44.156] (HELO yx-out-1718.google.com) (74.125.44.156) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Nov 2008 23:21:52 +0000 Received: by yx-out-1718.google.com with SMTP id 3so855706yxi.84 for ; Sun, 30 Nov 2008 15:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=keK/GSUbP5cTw4R2zFs0zRuqr/ESNbXHu7Ini3fw338=; b=YDFRwIgGMISZz11qMjr8DEJ1IeJBqspe3YB9bNdzlHRE95uzW36b97eJuhqBRtXk2r jlOjI3Z7sfiUVTc8USH3K7pUdIfh8sW8VpPYJbd12rAQLfC1eGwd+qtN5vV/GyrDn6fE cHgJFwr0bGYfiJ8MUld3qPIuXbRHcXMukx2bk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=iHQEdeRVxR4f9Wzq9NlFcVjYGDnOmchwvXehQRvlE9N9NZP9vbS8E5Jlxla7MhdSFK IMX3XTUKNEiFa8tvm3a3ZSu4+Lhjxd+Kx++h8gK3vTErCtF+e+J1H7c3Fh4TDvk4ju8p BklzRWhcm7Iwo5LKqMeYq0shQ9EdTHbzAivy4= Received: by 10.151.46.3 with SMTP id y3mr20530505ybj.199.1228087359319; Sun, 30 Nov 2008 15:22:39 -0800 (PST) Received: by 10.150.50.9 with HTTP; Sun, 30 Nov 2008 15:22:39 -0800 (PST) Message-ID: <1404e5910811301522r4fc8c748h205b5f9a9b7d8096@mail.gmail.com> Date: Sun, 30 Nov 2008 18:22:39 -0500 From: "Eric Covener" To: dev@httpd.apache.org Subject: Re: Handling AP_FILTER_ERROR In-Reply-To: <20081130222025.360e755e@grimnir> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081130222025.360e755e@grimnir> X-Virus-Checked: Checked by ClamAV on apache.org On Sun, Nov 30, 2008 at 5:20 PM, Nick Kew wrote: > In practice, the proposed fix looks good, and I want to > vote +1. I'm just a little concerned over whether we're > in danger of an infinite loop if we feed an AP_FILTER_ERROR > into ap_http_header_filter. The filter will just return > AP_FILTER_ERROR, and might get re-invoked with the error > still there. This is my first real pass through the filters, so please correct me if something looks fishy. If the filter is ever re-invoked, with the same brigade containing the error bucket, doesn't that mean an earlier filter (or handler) is looping over the same (uncleared) brigade? > Looking at ap_http_header_filter, if we encounter an error, > we first note it and continue. If we subsequently encounter > EOC, we'll return ap_pass_brigade and ignore the error > altogether. Otherwise we'll call ap_die (which is a no-op > if passed AP_FILTER_ERROR) and then return AP_FILTER_ERROR > up the stack, leaving the filter in place. Note that the ap_die() call in this context doesn't pass the filter chain rv (AP_FILTER_ERROR) but the stashed away HTTP error code that was pulled from the error bucket. This is the call that actually gets us the error response someone has queued up earlier (e.g. LimitRequestBody during the HTTP_IN filter) It's the later call to ap_die, back in ap_process_request, that should see AP_FILTER_ERROR and no-op. This is the return code that the general fix for PR#31759 is catching as non-HTTP and changing to 500. -- Eric Covener covener@gmail.com