From 09ffadf2e6c15476a900c20c22ec009fca2451fd Mon Sep 17 00:00:00 2001 From: ruanyuanyu Date: Wed, 8 May 2024 19:07:10 +0800 Subject: [PATCH] Fix compilation error when disable T_NGX_HTTP_UPSTREAM_ID --- .../ngx_http_upstream_session_sticky_module.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ngx_http_upstream_session_sticky_module/ngx_http_upstream_session_sticky_module.c b/modules/ngx_http_upstream_session_sticky_module/ngx_http_upstream_session_sticky_module.c index fc8445ce88..3c56d5cf9b 100644 --- a/modules/ngx_http_upstream_session_sticky_module/ngx_http_upstream_session_sticky_module.c +++ b/modules/ngx_http_upstream_session_sticky_module/ngx_http_upstream_session_sticky_module.c @@ -1341,6 +1341,7 @@ ngx_http_upstream_session_sticky_init_upstream(ngx_conf_t *cf, sscf->server[i].check_index = peer->check_index; #endif if (sscf->flag & NGX_HTTP_SESSION_STICKY_PLAIN) { +#if (T_NGX_HTTP_UPSTREAM_ID) if (peer->id.len == 0) { sscf->server[i].sid.data = peer->name.data; sscf->server[i].sid.len = peer->name.len; @@ -1349,7 +1350,10 @@ ngx_http_upstream_session_sticky_init_upstream(ngx_conf_t *cf, sscf->server[i].sid.data = peer->id.data; sscf->server[i].sid.len = peer->id.len; - +#else + sscf->server[i].sid.data = peer->name.data; + sscf->server[i].sid.len = peer->name.len; +#endif } else if (ngx_http_upstream_session_sticky_set_sid( cf, &sscf->server[i]) != NGX_OK) {