<div dir="ltr">Ping?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 5, 2013 at 1:20 PM, Fasih <span dir="ltr"><<a href="mailto:faskiri.devel@gmail.com" target="_blank">faskiri.devel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>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?</div>

<div><br></div><div>Lets say, I want to filter the body of the response to uppercase the body after 10 secs, how do I do that?</div><div><br></div><div>This is what I tried:</div><div>1. In the body filter, create a timer, set the handler to my function, and return NGX_DONE</div>

<div>2. In the handler, I call the next_body_filter</div><div><br></div><div>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.</div>

<div><br></div><div>Thanks!</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">+Fasih<br><br><div><h1 style="margin:0px;color:rgb(0,51,153);font-family:Arial,sans-serif;font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Life is 10% what happens to you and 90% how you react to it</h1></div></div>
</div>