And now I've described the problem, it looks like I've found the reason of my problem. I'll recheck it, but it looks like I'm incorrectly setting subrequest's discard_body value.
On Fri, Jul 19, 2013 at 2:26 AM, Marat Dakota <[email protected]> wrote: > Hi Yichun, > > It looks like it's not that simple. > > I've traced the source a bit, my post subrequest callback is called > from ngx_http_finalize_request() and this ngx_http_finalize_request() is > called from ngx_http_discarded_request_body_handler() like that (a piece of > code from ngx_http_request_body.c): > > if (rev->timedout) { > c->timedout = 1; > c->error = 1; > ngx_http_finalize_request(r, NGX_ERROR); > return; > } > > So, I have a timeout and c->error set to 1 and that > means ngx_http_terminate_request(). > > -- > Marat > > > On Thu, Jul 18, 2013 at 3:28 AM, Yichun Zhang (agentzh) <[email protected] > > wrote: > >> Hello! >> >> On Wed, Jul 17, 2013 at 2:56 PM, Marat Dakota wrote: >> > It looks like when a subrequest is completed with NGX_ERROR result (post >> > subrequest callback is called with NGX_ERROR status) and I try >> > ngx_http_output_filter for my main request after that, >> > ngx_http_output_filter returns NGX_ERROR too. >> > >> > I need to be able to continue sending my main request body normally. >> > >> > How to achieve that? >> > >> >> Easy. Just do not return NGX_ERROR in your post_subrequest handler >> when the error is not fatal enough to abort the main request. >> Otherwise, ngx_http_finalize_request will call >> ngx_http_terminate_request. >> >> Regards, >> -agentzh >> >> _______________________________________________ >> nginx-devel mailing list >> [email protected] >> http://mailman.nginx.org/mailman/listinfo/nginx-devel >> > >
_______________________________________________ nginx-devel mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx-devel
