diff --git a/ngx_tcp_upstream.c b/ngx_tcp_upstream.c index 6070f13..395a2cb 100644 --- a/ngx_tcp_upstream.c +++ b/ngx_tcp_upstream.c @@ -79,14 +79,14 @@ static ngx_command_t ngx_tcp_upstream_commands[] = { NGX_TCP_UPS_CONF|NGX_CONF_1MORE, ngx_conf_set_bitmask_slot, NGX_TCP_SRV_CONF_OFFSET, - offsetof(ngx_tcp_upstream_srv_conf_t, status_alive), + offsetof(ngx_tcp_upstream_srv_conf_t, code.status_alive), &ngx_check_http_expect_alive_masks }, { ngx_string("check_smtp_expect_alive"), NGX_TCP_UPS_CONF|NGX_CONF_1MORE, ngx_conf_set_bitmask_slot, NGX_TCP_SRV_CONF_OFFSET, - offsetof(ngx_tcp_upstream_srv_conf_t, status_alive), + offsetof(ngx_tcp_upstream_srv_conf_t, code.status_alive), &ngx_check_smtp_expect_alive_masks }, { ngx_string("check_shm_size"), @@ -658,7 +658,7 @@ ngx_tcp_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags) uscf->line = cf->conf_file->line; uscf->port = u->port; uscf->default_port = u->default_port; - uscf->status_alive = 0; + uscf->code.status_alive = 0; if (u->naddrs == 1) { uscf->servers = ngx_array_create(cf->pool, 1, diff --git a/ngx_tcp_upstream.h b/ngx_tcp_upstream.h index d977538..42ea806 100644 --- a/ngx_tcp_upstream.h +++ b/ngx_tcp_upstream.h @@ -117,7 +117,7 @@ struct ngx_tcp_upstream_srv_conf_s { union { ngx_uint_t return_code; ngx_uint_t status_alive; - }; + } code; }; diff --git a/ngx_tcp_upstream_check.c b/ngx_tcp_upstream_check.c index 0e4dcc3..7cae4b7 100644 --- a/ngx_tcp_upstream_check.c +++ b/ngx_tcp_upstream_check.c @@ -788,12 +788,12 @@ ngx_tcp_check_http_parse(ngx_tcp_check_peer_conf_t *peer_conf) ngx_log_debug2(NGX_LOG_DEBUG_TCP, ngx_cycle->log, 0, "http_parse: hp->status_code_n: %d, conf: %d", - hp->status_code_n, uscf->status_alive); + hp->status_code_n, uscf->code.status_alive); if (hp->status_code_n == 0) { return NGX_AGAIN; } - else if (hp->status_code_n & uscf->status_alive) { + else if (hp->status_code_n & uscf->code.status_alive) { return NGX_OK; } else { @@ -1068,12 +1068,12 @@ ngx_tcp_check_smtp_parse(ngx_tcp_check_peer_conf_t *peer_conf) ngx_log_debug2(NGX_LOG_DEBUG_TCP, ngx_cycle->log, 0, "smtp_parse: sp->hello_reply_code: %d, conf: %d", - sp->hello_reply_code, uscf->status_alive); + sp->hello_reply_code, uscf->code.status_alive); if (sp->hello_reply_code == 0) { return NGX_AGAIN; } - else if (sp->hello_reply_code & uscf->status_alive) { + else if (sp->hello_reply_code & uscf->code.status_alive) { return NGX_OK; } else { @@ -1605,8 +1605,8 @@ ngx_tcp_upstream_init_check_conf(ngx_tcp_upstream_srv_conf_t *uscf) uscf->send.len = cf->default_send.len; } - if (uscf->status_alive == 0) { - uscf->status_alive = cf->default_status_alive; + if (uscf->code.status_alive == 0) { + uscf->code.status_alive = cf->default_status_alive; } }