move condition declarations inside blocks where they are used
diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c index d5e8d64..0076e94 100644 --- a/src/http/modules/ngx_http_referer_module.c +++ b/src/http/modules/ngx_http_referer_module.c
@@ -106,11 +106,6 @@ ngx_uint_t i, key; ngx_http_referer_conf_t *rlcf; u_char buf[256]; -#if (NGX_PCRE) - ngx_int_t n; - ngx_str_t referer; - ngx_http_referer_regex_t *regex; -#endif rlcf = ngx_http_get_module_loc_conf(r, ngx_http_referer_module); @@ -173,6 +168,9 @@ #if (NGX_PCRE) if (rlcf->regex) { + ngx_int_t n; + ngx_str_t referer; + ngx_http_referer_regex_t *regex; referer.len = len - 7; referer.data = ref;
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c index ae72ee3..5e17cb5 100644 --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -2373,11 +2373,6 @@ ngx_str_t *expr, left, right; ngx_int_t rc; ngx_uint_t negative, noregex, flags; -#if (NGX_PCRE) - ngx_str_t err; - ngx_regex_t *regex; - u_char errstr[NGX_MAX_CONF_ERRSTR]; -#endif if (ctx->command.len == 2) { if (ctx->conditional) { @@ -2511,6 +2506,10 @@ } else { #if (NGX_PCRE) + ngx_str_t err; + ngx_regex_t *regex; + u_char errstr[NGX_MAX_CONF_ERRSTR]; + err.len = NGX_MAX_CONF_ERRSTR; err.data = errstr;
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 59b43d0..e3583a4 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c
@@ -101,9 +101,6 @@ #if (NGX_PCRE) ngx_uint_t regex; #endif -#if (NGX_WIN32) - ngx_iocp_conf_t *iocpcf; -#endif /* the main http context */ @@ -821,10 +818,14 @@ ls->log.handler = ngx_accept_log_error; #if (NGX_WIN32) + { + ngx_iocp_conf_t *iocpcf; + iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module); if (iocpcf->acceptex_read) { ls->post_accept_buffer_size = cscf->client_header_buffer_size; } + } #endif ls->backlog = in_addr[a].listen_conf->backlog;
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index b882f1c..dbfa91a 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c
@@ -1803,10 +1803,6 @@ ngx_http_conf_ctx_t *ctx, *pctx; ngx_http_core_srv_conf_t *cscf; ngx_http_core_loc_conf_t *clcf, *pclcf, **clcfp; -#if (NGX_PCRE) - ngx_str_t err; - u_char errstr[NGX_MAX_CONF_ERRSTR]; -#endif ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)); if (ctx == NULL) { @@ -1861,6 +1857,9 @@ && value[1].data[1] == '*')) { #if (NGX_PCRE) + ngx_str_t err; + u_char errstr[NGX_MAX_CONF_ERRSTR]; + err.len = NGX_MAX_CONF_ERRSTR; err.data = errstr; @@ -2803,10 +2802,6 @@ ngx_str_t *value, name; ngx_uint_t i; ngx_http_server_name_t *sn; -#if (NGX_PCRE) - ngx_str_t err; - u_char errstr[NGX_MAX_CONF_ERRSTR]; -#endif value = cf->args->elts; @@ -2882,6 +2877,10 @@ } #if (NGX_PCRE) + { + ngx_str_t err; + u_char errstr[NGX_MAX_CONF_ERRSTR]; + err.len = NGX_MAX_CONF_ERRSTR; err.data = errstr; @@ -2898,7 +2897,7 @@ sn->name.len = value[i].len; sn->name.data = value[i].data; - + } #else ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "the using of the regex \"%V\" "
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 3d06f96..51ec46c 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c
@@ -232,9 +232,6 @@ ngx_http_core_srv_conf_t *cscf; ngx_http_core_loc_conf_t *clcf; ngx_http_core_main_conf_t *cmcf; -#if (NGX_HTTP_SSL) - ngx_http_ssl_srv_conf_t *sscf; -#endif #if (NGX_STAT_STUB) ngx_atomic_fetch_add(ngx_stat_reading, -1); @@ -354,6 +351,9 @@ #if (NGX_HTTP_SSL) + { + ngx_http_ssl_srv_conf_t *sscf; + sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); if (sscf->enable) { @@ -370,6 +370,7 @@ r->main_filter_need_in_memory = 1; } + } #endif @@ -1398,11 +1399,7 @@ static void ngx_http_process_request(ngx_http_request_t *r) { - ngx_connection_t *c; -#if (NGX_HTTP_SSL) - long rc; - ngx_http_ssl_srv_conf_t *sscf; -#endif + ngx_connection_t *c; c = r->connection; @@ -1416,6 +1413,9 @@ #if (NGX_HTTP_SSL) if (c->ssl) { + long rc; + ngx_http_ssl_srv_conf_t *sscf; + sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); if (sscf->verify) { @@ -1469,12 +1469,6 @@ { ngx_http_core_loc_conf_t *clcf; ngx_http_core_srv_conf_t *cscf; -#if (NGX_PCRE) - ngx_int_t n; - ngx_uint_t i; - ngx_str_t name; - ngx_http_server_name_t *sn; -#endif cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, host, len); @@ -1485,6 +1479,10 @@ #if (NGX_PCRE) if (r->virtual_names->nregex) { + ngx_int_t n; + ngx_uint_t i; + ngx_str_t name; + ngx_http_server_name_t *sn; name.len = len; name.data = host;