Welcome! Log In Create A New Profile

Advanced

Re: ngx_http_v3_init_session function

Roman Arutyunyan
February 09, 2024 07:00AM
Hi Gabriel,

On Wed, Feb 07, 2024 at 03:34:42PM +0200, Clima Gabriel wrote:
> Hello Roman,
> Thank you. Noted about the mailing list.
>
>
> My function will be called from / inline in ngx_http_ssl_servername.
> ngx_http_ssl_servername itself is registered as a SNI TSL extensions
> callback like this:
>
> #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
>
> if (SSL_CTX_set_tlsext_servername_callback(conf->ssl.ctx,
> ngx_http_ssl_servername)
> == 0)
> {
> ngx_log_error(NGX_LOG_WARN, cf->log, 0,
> "nginx was built with SNI support, however, now it is linked "
> "dynamically to an OpenSSL library which has no tlsext support,
> "
> "therefore SNI is not available");
> }
>
> #endif
> ./src/http/modules/ngx_http_ssl_module.c

As you see in ngx_http_ssl_servername() code, it already assumes that c->data
references a ngx_http_connection_t object, so can you.

> Regards,
> Gabriel
>
> On Wed, Feb 7, 2024 at 11:29 AM Roman Arutyunyan <arut@nginx.com> wrote:
>
> > Hi,
> >
> > On Mon, Feb 05, 2024 at 11:24:39PM +0200, Clima Gabriel wrote:
> > > Hello everyone,
> > >
> > > (the code is probably clearer and attached below)
> >
> > Please note that this mailing list is not for development question.
> > We have a separate list nginx-devel@nginx.org for this.
> >
> > > This function modifies what ngx_connection_t->data points to.
> > > ngx_connection_t->data is initially *ngx_http_connection_t.
> > > The *ngx_http_connection_t is assigned to
> > > ngx_http_v3_session_t->http_connection
> > > And the *ngx_http_v3_session_t assigned to ngx_connection_t->data.
> > >
> > > Result: before ngx_connection_t->data is *ngx_http_connection_t
> > > after ngx_connection_t->data is *ngx_http_v3_session_t
> > >
> > > My question is: what is the proper way to find out what c->data is at any
> > > given time? I need to know this because I'm writing a function which uses
> > > the ngx_http_connection_t to obtain the hostname of the request, and it
> > may
> > > be invoked before or after the ngx_http_v3_init_session.
> >
> > There's no way to tell what object is referenced by c->data without taking
> > context into consideration. Similarly you can't do that for HTTP/1 as
> > well.
> >
> > You need to know what's the current connection stage to tell this.
> > ngx_http_v3_init_session() is called right before initializing QUIC
> > streams for
> > the session.
> >
> > When exactly do you call your function?
> >
> > [..]
> >
> > --
> > Roman Arutyunyan
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > https://mailman.nginx.org/mailman/listinfo/nginx
> >

> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> https://mailman.nginx.org/mailman/listinfo/nginx


--
Roman Arutyunyan
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

ngx_http_v3_init_session function

Clima Gabriel February 05, 2024 04:26PM

Re: ngx_http_v3_init_session function

J Carter February 05, 2024 07:18PM

Re: ngx_http_v3_init_session function

J Carter February 05, 2024 07:46PM

Re: ngx_http_v3_init_session function

J Carter February 06, 2024 12:10AM

Re: ngx_http_v3_init_session function

Roman Arutyunyan February 07, 2024 04:30AM

Re: ngx_http_v3_init_session function

Clima Gabriel February 07, 2024 08:36AM

Re: ngx_http_v3_init_session function

Roman Arutyunyan February 09, 2024 07:00AM

Re: ngx_http_v3_init_session function

Clima Gabriel February 14, 2024 11:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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