Re: Error handling from filter modules

2015-10-19 Thread Maxim Dounin
Hello! On Mon, Oct 19, 2015 at 11:02:53PM +0100, Steven Hartland wrote: [...] > >When the NGX_ERROR case is triggered, no response is returned, the > >connection is just closed. > It does seem like the connection to the client is just closed however a 206 > response is logged for the request in

Re: Error handling from filter modules

2015-10-19 Thread Steven Hartland
On 19/10/2015 17:59, Maxim Dounin wrote: Hello! On Fri, Oct 16, 2015 at 06:15:30PM +0100, Steven Hartland wrote: On 16/10/2015 13:20, Maxim Dounin wrote: Hello! On Fri, Oct 16, 2015 at 02:36:13AM +0100, Steven Hartland wrote: I'm making changes to a filter module and when it detected an

Re: Error handling from filter modules

2015-10-19 Thread Maxim Dounin
Hello! On Fri, Oct 16, 2015 at 06:15:30PM +0100, Steven Hartland wrote: > On 16/10/2015 13:20, Maxim Dounin wrote: > >Hello! > > > >On Fri, Oct 16, 2015 at 02:36:13AM +0100, Steven Hartland wrote: > > > >>I'm making changes to a filter module and when it detected an error it > >>returned NGX_ERRO

Re: Error handling from filter modules

2015-10-16 Thread Roman Arutyunyan
> On 16 Oct 2015, at 15:22, Maxim Dounin wrote: > > Hello! > > On Fri, Oct 16, 2015 at 03:16:23PM +0300, Roman Arutyunyan wrote: > >>> So the question is do filters have to manually call >>> ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); or is it >>> expected that the upper laye

Re: Error handling from filter modules

2015-10-16 Thread Steven Hartland
On 16/10/2015 13:20, Maxim Dounin wrote: Hello! On Fri, Oct 16, 2015 at 02:36:13AM +0100, Steven Hartland wrote: I'm making changes to a filter module and when it detected an error it returned NGX_ERROR however the response generated to the client isn't the expected 500 internal server error I

Re: Error handling from filter modules

2015-10-16 Thread Steven Hartland
After doing some more digging is seems a better manual call would be: return ngx_http_filter_finalize_request(r, &module, NGX_HTTP_INTERNAL_SERVER_ERROR); But it still leaves the question is it ever sensible to allow bad responses to be returned to the client in the case NGX_ERROR is returned

Re: Error handling from filter modules

2015-10-16 Thread Maxim Dounin
Hello! On Fri, Oct 16, 2015 at 03:16:23PM +0300, Roman Arutyunyan wrote: > > So the question is do filters have to manually call > > ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); or is it > > expected that the upper layers should actually do the right thing and > > ensure the clie

Re: Error handling from filter modules

2015-10-16 Thread Maxim Dounin
Hello! On Fri, Oct 16, 2015 at 02:36:13AM +0100, Steven Hartland wrote: > I'm making changes to a filter module and when it detected an error it > returned NGX_ERROR however the response generated to the client isn't > the expected 500 internal server error I would have expected given said > retu

Re: Error handling from filter modules

2015-10-16 Thread Roman Arutyunyan
Hello Steve, > On 16 Oct 2015, at 04:36, Steven Hartland > wrote: > > I'm making changes to a filter module Header filter or body filter? > and when it detected an error it > returned NGX_ERROR however the response generated to the client isn't > the expected 500 internal server error I would

Error handling from filter modules

2015-10-15 Thread Steven Hartland
I'm making changes to a filter module and when it detected an error it returned NGX_ERROR however the response generated to the client isn't the expected 500 internal server error I would have expected given said return. So the question is do filters have to manually call ngx_http_finalize_reques