[dev] some questions about subrequests

Sergey Bochenkov bachan at j3qq4.org
Thu Mar 27 17:28:48 MSK 2008


NGX_HTTP_ZERO_IN_URI:

src/http/ngx_http_core_module.c:
    sr->zero_in_uri = (flags & NGX_HTTP_ZERO_IN_URI) != 0;

src/http/ngx_http_request.h:
    /* URI with "\0" or "%00" */
    unsigned zero_in_uri:1;

Obviously, IMHO.


NGX_HTTP_SUBREQUEST_IN_MEMORY:

src/http/ngx_http_core_module.c:
sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;

src/http/ngx_http_upstream.c:
    if (!r->subrequest_in_memory) {
        ngx_http_upstream_send_response(r, u);
        return;
    }

    /* subrequest content in memory */

    ...

So, as I can understand from using-of-subrequests point of view,
r->subrequest_in_memory flag tells ngx_http_upstream_module to save a
pointer to the full chain of response buffers in r->upstream->out_bufs
chain-link. And *not-to-free* that buffers after subrequest was
finished.

Fix me, if I'm wrong.


> Hi.
> 
> I would like to add subrequests support in the WSGI module, however I 
> have some doubts.
> 
> What's the meaning of the NGX_HTTP_ZERO_IN_URI and 
> NGX_HTTP_SUBREQUEST_IN_MEMORY flags?
> 
> 
> 
> Thanks  Manlio Perillo
> 
> 








More information about the nginx mailing list