Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 71046 invoked from network); 11 Feb 2010 19:48:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Feb 2010 19:48:19 -0000 Received: (qmail 88198 invoked by uid 500); 11 Feb 2010 19:48:18 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 88126 invoked by uid 500); 11 Feb 2010 19:48:18 -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 88117 invoked by uid 99); 11 Feb 2010 19:48:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 19:48:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.66.64.76] (HELO mailhost.clove.org) (208.66.64.76) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 11 Feb 2010 19:48:10 +0000 Received: (qmail 84804 invoked by uid 1014); 11 Feb 2010 11:43:31 -0800 Received: from c-67-174-196-151.hsd1.ca.comcast.net (HELO [10.0.1.10]) (67.174.196.151) (smtp-auth username aaron, mechanism plain) by clove.org (qpsmtpd/0.32) with ESMTP; Thu, 11 Feb 2010 11:43:30 -0800 Message-Id: <37ABF8AC-41AD-4D48-B4BA-D60AC1490E77@clove.org> From: Aaron Bannert To: dev@httpd.apache.org In-Reply-To: <99EA83DCDE961346AFA9B5EC33FEC08B036339F5@VF-MBX11.internal.vodafone.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: mod_proxy_http ignores errors from ap_pass_brigade(r->output_filters) Date: Thu, 11 Feb 2010 11:47:43 -0800 References: <20100210230416.GB11076@grover.clove.org> <99EA83DCDE961346AFA9B5EC33FEC08B036339F5@VF-MBX11.internal.vodafone.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Check-By: clove.org X-Old-Spam-Status: No, hits=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 On Feb 10, 2010, at 11:34 PM, Pl=FCm, R=FCdiger, VF-Group wrote: > >> -----Original Message----- >> From: Aaron Bannert >> Sent: Donnerstag, 11. Februar 2010 00:04 >> To: dev@httpd.apache.org >> Subject: mod_proxy_http ignores errors from >> ap_pass_brigade(r->output_filters) >> >> mod_proxy_http appears to be ignoring errors returned from >> ap_pass_brigade >> (when passing down the output_filter stack). This is a problem for =20= >> any >> output filter that has a fatal error and wishes to signal that error >> to the client (eg. HTTP_INTERNAL_SERVER_ERROR). I'm not >> familiar enough >> with the current mod_proxy code to know if I did this correctly, but >> this patch works for me. I also went ahead and marked the places =20 >> where >> we (kind of hackishly) ignore the return values intentionally. >> >> Could someone review this and let me know if I'm on the right track >> (against 2.2.x branch)? > > IMHO this is unneeded and indicates a bug in the according filter. > Filters return apr error codes and not HTTP status codes. If they wish > to set a specific status code they should pass an error bucket down =20= > the > chain or set r->status appropriately. You are correct that filters should be returning apr status codes and not http status codes, thanks for pointing that out. I'm still a little concerned about how this is supposed to work though, since it seems like the mod_proxy_http handler behaves differently than the default handler. The default handler will return HTTP_INTERNAL_SERVER_ERROR if the output filter stack returns an error (unless r->status or c->aborted are set); while the proxy handler will return an OK when this happens. The problem here is that when this happens, if there were no buckets passed down the output filter stack, then Apache just hangs up on the client and produces nothing, when it should probably be producing a 500 error. Is this supposed to happen? Also, I don't see many modules that are passing error buckets when they have errors in their filters. Most appear to return errors which will probably be ignored if run from underneath mod_proxy. There are only a few that create error buckets and pass them though (I only found mod_ext_filter, byterange_filter, proxy_util, and the core http_filter). Thanks, -aaron