Welcome! Log In Create A New Profile

Advanced

NGX_STREAM_UPS_CONF handling

Benjamin Coddington
October 21, 2021 12:22PM
Hi devs, I'm new here, be gentle.

I'm hacking up a tls offloading proxy for sunrpc, getting up to speed on
nginx codebase, but I'm sinking too much time into figuring something:

I'd like to use a flag configuration directive within an upstream config
stanza:

static ngx_command_t
ngx_stream_rpc_tls_commands[] = {

{ ngx_string("rpc_tls_client"),
NGX_STREAM_SRV_CONF|NGX_STREAM_UPS_CONF|NGX_CONF_FLAG,
ngx_conf_set_flag_slot,
NGX_STREAM_SRV_CONF_OFFSET,
offsetof(ngx_stream_rpc_tls_conf_t, client),
NULL },

ngx_null_command
};

... but when I go to merge server configs, the value is always unset. The
debugger showed me that the upstream module does its own pass at

module->create_srv_conf

and

ngx_conf_parse()

so the configuration, while set, isn't there in my merge server config
function, it's somewhere else and I'm not sure how to access it.

I'm at the point where it feels like I'm "doing it wrong". What's the
correct way to have both NGX_STREAM_SRV_CONF|NGX_CONF_FLAG and
NGX_STREAM_SRV_CONF|NGX_STREAM_UPS_CONF|NGX_CONF_FLAG directives in the same
module that can be handled by the same module's configuration?

Ben

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

NGX_STREAM_UPS_CONF handling

Benjamin Coddington 274 October 21, 2021 12:22PM

Re: NGX_STREAM_UPS_CONF handling

Maxim Dounin 136 October 21, 2021 09:42PM



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

Online Users

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