Welcome! Log In Create A New Profile

Advanced

Re: stop body filter execution until header_filter chain is finished

Maxim Dounin
August 07, 2010 04:46PM
Hello!

On Fri, Aug 06, 2010 at 05:10:18PM +0200, Mirko Dziadzka wrote:

> Hi
>
> I'm using a header-filter and a body-filter.
>
> The header filter creates a subrequest and change the header in response
>
> static ngx_int_t aod_response_header_filter(ngx_http_request_t *r)
> {
> if (ctx->state == ...)
> {
> // setup subrequest
> ...
> res = ngx_http_subrequest(....)
> return NGX_AGAIN;
> }
>
> // handle subrequest response
> ....
> return aod_enforcer_next_header_filter(r);
> }
> so far, this works fine. However, during the execution of the
> subrequest, the response_body_filter of the main request is called. Is
> there a way to postpone this until the header_filter is finished?

Body chunks are serialized in postpone filter. If you want them
in correct order - you have to add your body filter after postpone
one.

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

stop body filter execution until header_filter chain is finished

Mirko Dziadzka 2484 August 06, 2010 11:12AM

Re: stop body filter execution until header_filter chain is finished

Maxim Dounin 1627 August 07, 2010 04:46PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 298
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready