From c3692474cebc6e191760a09327d58f9271de2048 Mon Sep 17 00:00:00 2001 From: Mathew Date: Thu, 4 Jan 2024 19:03:29 +1100 Subject: [PATCH] add max_conns to jdomain --- src/ngx_http_upstream_jdomain_module.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ngx_http_upstream_jdomain_module.c b/src/ngx_http_upstream_jdomain_module.c index 3223e7a..104f02f 100644 --- a/src/ngx_http_upstream_jdomain_module.c +++ b/src/ngx_http_upstream_jdomain_module.c @@ -23,6 +23,7 @@ #define NGX_JDOMAIN_ARG_STR_MAX_IPS "max_ips=" #define NGX_JDOMAIN_ARG_STR_PORT "port=" #define NGX_JDOMAIN_ARG_STR_IPVER "ipver=" +#define NGX_JDOMAIN_ARG_STR_MAX_CONNS "max_conns=" #define NGX_JDOMAIN_ARG_STR_STRICT "strict" typedef struct @@ -603,6 +604,14 @@ ngx_http_upstream_jdomain(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) continue; } + arglen = ngx_strlen(NGX_JDOMAIN_ARG_STR_MAX_CONNS); + if (ngx_strncmp(value[i].data, NGX_JDOMAIN_ARG_STR_MAX_CONNS, arglen) == 0) { + num = ngx_atoi(value[i].data + arglen, value[i].len - arglen); + server->max_conns = num; + + continue; + } + goto invalid; }