Mercurial > hg > nginx-mail
comparison src/http/modules/ngx_http_proxy_module.c @ 536:f39b9e29530d NGINX_0_8_0
nginx 0.8.0
*) Feature: the "keepalive_requests" directive.
*) Feature: the "limit_rate_after" directive.
Thanks to Ivan Debnar.
*) Bugfix: XLST filter did not work in subrequests.
*) Bugfix: in relative paths handling in nginx/Windows.
*) Bugfix: in proxy_store, fastcgi_store, proxy_cache, and
fastcgi_cache in nginx/Windows.
*) Bugfix: in memory allocation error handling.
Thanks to Maxim Dounin and Kirill A. Korinskiy.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 02 Jun 2009 00:00:00 +0400 |
parents | 499474178a11 |
children | 207ae3ff0444 |
comparison
equal
deleted
inserted
replaced
535:6d9fb4461113 | 536:f39b9e29530d |
---|---|
1881 { | 1881 { |
1882 ngx_http_proxy_loc_conf_t *conf; | 1882 ngx_http_proxy_loc_conf_t *conf; |
1883 | 1883 |
1884 conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_proxy_loc_conf_t)); | 1884 conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_proxy_loc_conf_t)); |
1885 if (conf == NULL) { | 1885 if (conf == NULL) { |
1886 return NGX_CONF_ERROR; | 1886 return NULL; |
1887 } | 1887 } |
1888 | 1888 |
1889 /* | 1889 /* |
1890 * set by ngx_pcalloc(): | 1890 * set by ngx_pcalloc(): |
1891 * | 1891 * |
1971 ngx_http_proxy_redirect_t *pr; | 1971 ngx_http_proxy_redirect_t *pr; |
1972 ngx_http_script_compile_t sc; | 1972 ngx_http_script_compile_t sc; |
1973 | 1973 |
1974 if (conf->upstream.store != 0) { | 1974 if (conf->upstream.store != 0) { |
1975 ngx_conf_merge_value(conf->upstream.store, | 1975 ngx_conf_merge_value(conf->upstream.store, |
1976 prev->upstream.store, 0); | 1976 prev->upstream.store, 0); |
1977 | 1977 |
1978 if (conf->upstream.store_lengths == NULL) { | 1978 if (conf->upstream.store_lengths == NULL) { |
1979 conf->upstream.store_lengths = prev->upstream.store_lengths; | 1979 conf->upstream.store_lengths = prev->upstream.store_lengths; |
1980 conf->upstream.store_values = prev->upstream.store_values; | 1980 conf->upstream.store_values = prev->upstream.store_values; |
1981 } | 1981 } |
2807 ngx_http_proxy_loc_conf_t *plcf = conf; | 2807 ngx_http_proxy_loc_conf_t *plcf = conf; |
2808 | 2808 |
2809 ngx_str_t *value; | 2809 ngx_str_t *value; |
2810 ngx_http_script_compile_t sc; | 2810 ngx_http_script_compile_t sc; |
2811 | 2811 |
2812 if (plcf->upstream.store != NGX_CONF_UNSET || plcf->upstream.store_lengths) | 2812 if (plcf->upstream.store != NGX_CONF_UNSET |
2813 || plcf->upstream.store_lengths) | |
2813 { | 2814 { |
2814 return "is duplicate"; | 2815 return "is duplicate"; |
2815 } | 2816 } |
2816 | 2817 |
2817 value = cf->args->elts; | 2818 value = cf->args->elts; |
2818 | 2819 |
2820 if (ngx_strcmp(value[1].data, "off") == 0) { | |
2821 plcf->upstream.store = 0; | |
2822 return NGX_CONF_OK; | |
2823 } | |
2824 | |
2825 #if (NGX_HTTP_CACHE) | |
2826 | |
2827 if (plcf->upstream.cache != NGX_CONF_UNSET_PTR | |
2828 && plcf->upstream.cache != NULL) | |
2829 { | |
2830 return "is incompatible with \"proxy_cache\""; | |
2831 } | |
2832 | |
2833 #endif | |
2834 | |
2819 if (ngx_strcmp(value[1].data, "on") == 0) { | 2835 if (ngx_strcmp(value[1].data, "on") == 0) { |
2820 plcf->upstream.store = 1; | 2836 plcf->upstream.store = 1; |
2821 return NGX_CONF_OK; | |
2822 } | |
2823 | |
2824 if (ngx_strcmp(value[1].data, "off") == 0) { | |
2825 plcf->upstream.store = 0; | |
2826 return NGX_CONF_OK; | 2837 return NGX_CONF_OK; |
2827 } | 2838 } |
2828 | 2839 |
2829 /* include the terminating '\0' into script */ | 2840 /* include the terminating '\0' into script */ |
2830 value[1].len++; | 2841 value[1].len++; |
2863 } | 2874 } |
2864 | 2875 |
2865 if (ngx_strcmp(value[1].data, "off") == 0) { | 2876 if (ngx_strcmp(value[1].data, "off") == 0) { |
2866 plcf->upstream.cache = NULL; | 2877 plcf->upstream.cache = NULL; |
2867 return NGX_CONF_OK; | 2878 return NGX_CONF_OK; |
2879 } | |
2880 | |
2881 if (plcf->upstream.store > 0 || plcf->upstream.store_lengths) { | |
2882 return "is incompatible with \"proxy_store\""; | |
2868 } | 2883 } |
2869 | 2884 |
2870 plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, | 2885 plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, |
2871 &ngx_http_proxy_module); | 2886 &ngx_http_proxy_module); |
2872 if (plcf->upstream.cache == NULL) { | 2887 if (plcf->upstream.cache == NULL) { |