How to abort subrequest properly?

Yichun Zhang (agentzh) agentzh at
Tue Jul 9 03:38:51 UTC 2013


On Thu, Jul 4, 2013 at 3:41 AM, Marcus Clyne <ngx.eugaia at> wrote:
> The upstream request obviously
> needs to be closed properly, but if the upstream cleanup function is going
> to be called anyway by the main request, then I'm not sure it really makes
> any difference, and you'd be running through the cleanup function twice.

The cleanup function usually protects against being called multiple
times by means of something like the following code snippet:

    if (u->cleanup) {
        *u->cleanup = NULL;
        u->cleanup = NULL;

So it won't be an issue here at all.


More information about the nginx-devel mailing list