diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2007-12-10 12:09:51 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2007-12-10 12:09:51 +0000 |
| commit | 86ef6aaa6b574f2015a5094670b7123c425a63af (patch) | |
| tree | e0b78dcc48085162b29fbff2c0aeb7e5bd75c654 /src/http | |
| parent | e60049418525a5e605765aa2b8f9c6796eb390a6 (diff) | |
| download | nginx-86ef6aaa6b574f2015a5094670b7123c425a63af.tar.gz nginx-86ef6aaa6b574f2015a5094670b7123c425a63af.tar.bz2 | |
move condition declarations inside blocks where they are used
Diffstat (limited to 'src/http')
| -rw-r--r-- | src/http/modules/ngx_http_referer_module.c | 8 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_ssi_filter_module.c | 9 | ||||
| -rw-r--r-- | src/http/ngx_http.c | 7 | ||||
| -rw-r--r-- | src/http/ngx_http_core_module.c | 17 | ||||
| -rw-r--r-- | src/http/ngx_http_request.c | 26 |
5 files changed, 31 insertions, 36 deletions
diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c index d5e8d6482..0076e9472 100644 --- a/src/http/modules/ngx_http_referer_module.c +++ b/src/http/modules/ngx_http_referer_module.c @@ -106,11 +106,6 @@ ngx_http_referer_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, 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 @@ ngx_http_referer_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, #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 ae72ee379..5e17cb59f 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_http_ssi_if(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, 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 @@ ngx_http_ssi_if(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, } 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 59b43d054..e3583a4f8 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -101,9 +101,6 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) #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 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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 b882f1c2f..dbfa91ac6 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1803,10 +1803,6 @@ ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) 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 @@ ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) && 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_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } #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 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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 3d06f964f..51ec46ce7 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -232,9 +232,6 @@ ngx_http_init_request(ngx_event_t *rev) 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 @@ ngx_http_init_request(ngx_event_t *rev) #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 @@ ngx_http_init_request(ngx_event_t *rev) r->main_filter_need_in_memory = 1; } + } #endif @@ -1398,11 +1399,7 @@ ngx_http_process_request_header(ngx_http_request_t *r) 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 @@ ngx_http_process_request(ngx_http_request_t *r) #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_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len, { 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 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len, #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; |
