diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c index 2be0672148..98cdf74d44 100644 --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -521,6 +521,15 @@ static ngx_command_t ngx_http_fastcgi_commands[] = { offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream_tries), NULL }, +#if (T_UPSTREAM_TRIES) + { ngx_string("fastcgi_upstream_tries"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, + ngx_conf_set_num_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream_tries), + NULL }, +#endif + { ngx_string("fastcgi_next_upstream_timeout"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_msec_slot, diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c index 54dc0b919b..1c74a4e513 100644 --- a/src/http/modules/ngx_http_memcached_module.c +++ b/src/http/modules/ngx_http_memcached_module.c @@ -135,7 +135,7 @@ static ngx_command_t ngx_http_memcached_commands[] = { NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_num_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memcached_loc_conf_t, upstream.upstream_tries), + offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream_tries), NULL }, #endif @@ -613,6 +613,7 @@ ngx_http_memcached_create_loc_conf(ngx_conf_t *cf) conf->upstream.local = NGX_CONF_UNSET_PTR; conf->upstream.socket_keepalive = NGX_CONF_UNSET; conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; + conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC; conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC; conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC; @@ -620,9 +621,6 @@ ngx_http_memcached_create_loc_conf(ngx_conf_t *cf) conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE; -#if (T_UPSTREAM_TRIES) - conf->upstream.upstream_tries = NGX_CONF_UNSET_UINT; -#endif /* the hardcoded values */ conf->upstream.cyclic_temp_file = 0; @@ -688,11 +686,6 @@ ngx_http_memcached_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) |NGX_HTTP_UPSTREAM_FT_OFF; } -#if (T_UPSTREAM_TRIES) - ngx_conf_merge_uint_value(conf->upstream.upstream_tries, - prev->upstream.upstream_tries, - NGX_CONF_UNSET_UINT); -#endif if (conf->upstream.upstream == NULL) { conf->upstream.upstream = prev->upstream.upstream; diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index a904b909c4..4f5b05db65 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -606,7 +606,7 @@ static ngx_command_t ngx_http_proxy_commands[] = { NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_num_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_proxy_loc_conf_t, upstream.upstream_tries), + offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream_tries), NULL }, #endif @@ -2864,10 +2864,6 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf) conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE; conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE; -#if (T_UPSTREAM_TRIES) - conf->upstream.upstream_tries = NGX_CONF_UNSET_UINT; -#endif - conf->upstream.pass_request_headers = NGX_CONF_UNSET; conf->upstream.pass_request_body = NGX_CONF_UNSET; @@ -3106,12 +3102,6 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) |NGX_HTTP_UPSTREAM_FT_OFF; } -#if (T_UPSTREAM_TRIES) - ngx_conf_merge_uint_value(conf->upstream.upstream_tries, - prev->upstream.upstream_tries, - NGX_CONF_UNSET_UINT); -#endif - if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path, prev->upstream.temp_path, &ngx_http_proxy_temp_path) diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c index b6d8aba940..ef251fb092 100644 --- a/src/http/modules/ngx_http_scgi_module.c +++ b/src/http/modules/ngx_http_scgi_module.c @@ -369,7 +369,7 @@ static ngx_command_t ngx_http_scgi_commands[] = { NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_num_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_scgi_loc_conf_t, upstream.upstream_tries), + offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream_tries), NULL }, #endif @@ -1210,6 +1210,7 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t *cf) conf->upstream.store = NGX_CONF_UNSET; conf->upstream.store_access = NGX_CONF_UNSET_UINT; conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; + conf->upstream.buffering = NGX_CONF_UNSET; conf->upstream.request_buffering = NGX_CONF_UNSET; conf->upstream.ignore_client_abort = NGX_CONF_UNSET; @@ -1230,11 +1231,6 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t *cf) conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE; conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE; conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE; - -#if (T_UPSTREAM_TRIES) - conf->upstream.upstream_tries = NGX_CONF_UNSET_UINT; -#endif - conf->upstream.pass_request_headers = NGX_CONF_UNSET; conf->upstream.pass_request_body = NGX_CONF_UNSET; @@ -1448,12 +1444,6 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) |NGX_HTTP_UPSTREAM_FT_ERROR |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); -#if (T_UPSTREAM_TRIES) - ngx_conf_merge_uint_value(conf->upstream.upstream_tries, - prev->upstream.upstream_tries, - NGX_CONF_UNSET_UINT); -#endif - if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) { conf->upstream.next_upstream = NGX_CONF_BITMASK_SET |NGX_HTTP_UPSTREAM_FT_OFF; diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c index a66d1785ba..cd3bf4b502 100644 --- a/src/http/modules/ngx_http_uwsgi_module.c +++ b/src/http/modules/ngx_http_uwsgi_module.c @@ -444,7 +444,7 @@ static ngx_command_t ngx_http_uwsgi_commands[] = { NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_num_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_uwsgi_loc_conf_t, upstream.upstream_tries), + offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_tries), NULL }, #endif @@ -1423,6 +1423,7 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf) conf->upstream.store = NGX_CONF_UNSET; conf->upstream.store_access = NGX_CONF_UNSET_UINT; conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; + conf->upstream.buffering = NGX_CONF_UNSET; conf->upstream.request_buffering = NGX_CONF_UNSET; conf->upstream.ignore_client_abort = NGX_CONF_UNSET; @@ -1443,11 +1444,6 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf) conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE; conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE; conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE; - -#if (T_UPSTREAM_TRIES) - conf->upstream.upstream_tries = NGX_CONF_UNSET_UINT; -#endif - conf->upstream.pass_request_headers = NGX_CONF_UNSET; conf->upstream.pass_request_body = NGX_CONF_UNSET; @@ -1669,12 +1665,6 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) |NGX_HTTP_UPSTREAM_FT_ERROR |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); -#if (T_UPSTREAM_TRIES) - ngx_conf_merge_uint_value(conf->upstream.upstream_tries, - prev->upstream.upstream_tries, - NGX_CONF_UNSET_UINT); -#endif - if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) { conf->upstream.next_upstream = NGX_CONF_BITMASK_SET |NGX_HTTP_UPSTREAM_FT_OFF; diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index f6b8433ab9..f0914bc55e 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2435,10 +2435,6 @@ ngx_http_subrequest(ngx_http_request_t *r, c = r->connection; sr->connection = c; -#if (T_UPSTREAM_TRIES) - sr->us_tries = 1; -#endif - sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module); if (sr->ctx == NULL) { return NGX_ERROR; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 542df45277..629b81244e 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -648,10 +648,6 @@ ngx_http_alloc_request(ngx_connection_t *c) r->main = r; r->count = 1; -#if (T_UPSTREAM_TRIES) - r->us_tries = 1; -#endif - #if (T_NGX_RET_CACHE) { struct timeval tv; diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index a2605cc72d..619ee2c07d 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -449,10 +449,6 @@ struct ngx_http_request_s { ngx_uint_t err_status; -#if (T_UPSTREAM_TRIES) - ngx_uint_t us_tries; -#endif - ngx_http_connection_t *http_connection; ngx_http_v2_stream_t *stream; diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h index 993cd5b0da..da07155ee5 100644 --- a/src/http/ngx_http_upstream.h +++ b/src/http/ngx_http_upstream.h @@ -197,9 +197,6 @@ typedef struct { ngx_uint_t ignore_headers; ngx_uint_t next_upstream; -#if (T_UPSTREAM_TRIES) - ngx_uint_t upstream_tries; -#endif ngx_uint_t store_access; ngx_uint_t next_upstream_tries; ngx_flag_t buffering;