Welcome! Log In Create A New Profile

Advanced

Question about asynchronous filter_header/body

November 05, 2013 02:52AM
Hi

I want to have a filter header/body that makes an asynchronous call. On
success, a completion handler is called. The result of this completion
handler decides the output of filter header/body. I understand subrequest
can be used to do this. But are there alternatives to this?

Lets say, I want to filter the body of the response to uppercase the body
after 10 secs, how do I do that?

This is what I tried:
1. In the body filter, create a timer, set the handler to my function, and
return NGX_DONE
2. In the handler, I call the next_body_filter

This works but there are edgecases that I am not sure how to handle, e.g.
how to handle errors from next_body_filter, (specifically NGX_AGAIN) and so
on. Pointers will be greatly appreciated.

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

Question about asynchronous filter_header/body

faskiri.devel 860 November 05, 2013 02:52AM

Re: Question about asynchronous filter_header/body

Fasihullah Askiri 382 November 07, 2013 05:58AM



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

Online Users

Guests: 165
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