When r != r->connection->data

Marat Dakota dakota at brokenpipe.ru
Mon Mar 16 00:05:37 UTC 2015


Hello again.

I'm still struggling with the subrequests. And it looks like I've solved
the most of everything, except for this.

In a few modules I've found a trick:

if (r != r->connection->data)
    r->connection->data = r;

I've put this code to my post subrequest callback and before
ngx_http_output_filter() call.
If I remove this code, the request processing will hang dead.

With this code my simple tests work fine. But when I try to make a
subrequest from a subrequest I get something like this in the error log:

2015/03/16 02:55:39 [alert] 73485#0: *2 subrequest: "/lalala/?" logged
again, client: 127.0.0.1, server: localhost, request: "POST /test1
HTTP/1.1", subrequest: "/lalala/", host: "localhost"

And it looks like the subrequest processing is called twice.

My question is about the proper scenario to handle the situation and about
what exactly r != r->connection->data means.

Thanks.

--
Marat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20150316/d29dc0e1/attachment.html>


More information about the nginx-devel mailing list