Welcome! Log In Create A New Profile

Advanced

Re: Proxy : Why two places request structure is stored in upstream

Maxim Dounin
November 24, 2014 08:02AM
Hello!

On Sat, Nov 22, 2014 at 01:44:06PM +0530, punit kandoi wrote:

> Hi,
>
> I was reading world famous tutorial by Emiller. Nginx guide to module
> development.
>
> I was going to ngx_http_proxy_handler() as described in tutorial.
>
> I seen request structure is stored in two places in upstream.
>
> u->pipe->input_filter = ngx_http_proxy_copy_filter;
> u->pipe->input_ctx = r; <<------
>
> u->input_filter_init = ngx_http_proxy_input_filter_init;
> u->input_filter = ngx_http_proxy_non_buffered_copy_filter;
> u->input_filter_ctx = r; <<------
>
> Whats the difference between two variables?

The "u->pipe->input_ctx" context is for ngx_event_pipe() code, to
be used by buffered input filters when needed.

The "u->input_filter_ctx" context is for non-buffered filters.

> If we want to take request structure from upstream in later stage before
> selecting server which value to be used?

Both of the above are wrong if you aren't writing an input filter.

--
Maxim Dounin
http://nginx.org/

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

Proxy : Why two places request structure is stored in upstream

punit kandoi 567 November 22, 2014 03:16AM

Re: Proxy : Why two places request structure is stored in upstream

Maxim Dounin 391 November 24, 2014 08:02AM



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

Online Users

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