Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 1704:e584e946e198
move condition declarations inside blocks where they are used
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 10 Dec 2007 12:09:51 +0000 |
parents | 1e0b028055ec |
children | c42431762903 |
comparison
equal
deleted
inserted
replaced
1703:43747661804d | 1704:e584e946e198 |
---|---|
1801 ngx_conf_t save; | 1801 ngx_conf_t save; |
1802 ngx_http_module_t *module; | 1802 ngx_http_module_t *module; |
1803 ngx_http_conf_ctx_t *ctx, *pctx; | 1803 ngx_http_conf_ctx_t *ctx, *pctx; |
1804 ngx_http_core_srv_conf_t *cscf; | 1804 ngx_http_core_srv_conf_t *cscf; |
1805 ngx_http_core_loc_conf_t *clcf, *pclcf, **clcfp; | 1805 ngx_http_core_loc_conf_t *clcf, *pclcf, **clcfp; |
1806 #if (NGX_PCRE) | |
1807 ngx_str_t err; | |
1808 u_char errstr[NGX_MAX_CONF_ERRSTR]; | |
1809 #endif | |
1810 | 1806 |
1811 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)); | 1807 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)); |
1812 if (ctx == NULL) { | 1808 if (ctx == NULL) { |
1813 return NGX_CONF_ERROR; | 1809 return NGX_CONF_ERROR; |
1814 } | 1810 } |
1859 || (value[1].len == 2 | 1855 || (value[1].len == 2 |
1860 && value[1].data[0] == '~' | 1856 && value[1].data[0] == '~' |
1861 && value[1].data[1] == '*')) | 1857 && value[1].data[1] == '*')) |
1862 { | 1858 { |
1863 #if (NGX_PCRE) | 1859 #if (NGX_PCRE) |
1860 ngx_str_t err; | |
1861 u_char errstr[NGX_MAX_CONF_ERRSTR]; | |
1862 | |
1864 err.len = NGX_MAX_CONF_ERRSTR; | 1863 err.len = NGX_MAX_CONF_ERRSTR; |
1865 err.data = errstr; | 1864 err.data = errstr; |
1866 | 1865 |
1867 clcf->regex = ngx_regex_compile(&value[2], | 1866 clcf->regex = ngx_regex_compile(&value[2], |
1868 value[1].len == 2 ? NGX_REGEX_CASELESS: 0, | 1867 value[1].len == 2 ? NGX_REGEX_CASELESS: 0, |
2801 | 2800 |
2802 u_char ch; | 2801 u_char ch; |
2803 ngx_str_t *value, name; | 2802 ngx_str_t *value, name; |
2804 ngx_uint_t i; | 2803 ngx_uint_t i; |
2805 ngx_http_server_name_t *sn; | 2804 ngx_http_server_name_t *sn; |
2806 #if (NGX_PCRE) | |
2807 ngx_str_t err; | |
2808 u_char errstr[NGX_MAX_CONF_ERRSTR]; | |
2809 #endif | |
2810 | 2805 |
2811 value = cf->args->elts; | 2806 value = cf->args->elts; |
2812 | 2807 |
2813 ch = value[1].data[0]; | 2808 ch = value[1].data[0]; |
2814 | 2809 |
2880 if (value[i].data[0] != '~') { | 2875 if (value[i].data[0] != '~') { |
2881 continue; | 2876 continue; |
2882 } | 2877 } |
2883 | 2878 |
2884 #if (NGX_PCRE) | 2879 #if (NGX_PCRE) |
2880 { | |
2881 ngx_str_t err; | |
2882 u_char errstr[NGX_MAX_CONF_ERRSTR]; | |
2883 | |
2885 err.len = NGX_MAX_CONF_ERRSTR; | 2884 err.len = NGX_MAX_CONF_ERRSTR; |
2886 err.data = errstr; | 2885 err.data = errstr; |
2887 | 2886 |
2888 value[i].len--; | 2887 value[i].len--; |
2889 value[i].data++; | 2888 value[i].data++; |
2896 return NGX_CONF_ERROR; | 2895 return NGX_CONF_ERROR; |
2897 } | 2896 } |
2898 | 2897 |
2899 sn->name.len = value[i].len; | 2898 sn->name.len = value[i].len; |
2900 sn->name.data = value[i].data; | 2899 sn->name.data = value[i].data; |
2901 | 2900 } |
2902 #else | 2901 #else |
2903 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 2902 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
2904 "the using of the regex \"%V\" " | 2903 "the using of the regex \"%V\" " |
2905 "requires PCRE library", &value[i]); | 2904 "requires PCRE library", &value[i]); |
2906 | 2905 |