Mercurial > hg > nginx-vendor-1-0
comparison src/http/modules/ngx_http_proxy_module.c @ 576:01f2313e34f1 NGINX_0_8_40
nginx 0.8.40
*) Security: now nginx/Windows ignores default file stream name.
Thanks to Jose Antonio Vazquez Gonzalez.
*) Feature: the ngx_http_uwsgi_module.
Thanks to Roberto De Ioris.
*) Feature: a "fastcgi_param" directive with value starting with
"HTTP_" overrides a client request header line.
*) Bugfix: the "If-Modified-Since", "If-Range", etc. client request
header lines were passed to FastCGI-server while caching.
*) Bugfix: listen unix domain socket could not be changed during
reconfiguration.
Thanks to Maxim Dounin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 07 Jun 2010 00:00:00 +0400 |
parents | ff463db0be31 |
children | bc110f60c0de |
comparison
equal
deleted
inserted
replaced
575:6ad548c0b830 | 576:01f2313e34f1 |
---|---|
49 ngx_array_t *headers_set_len; | 49 ngx_array_t *headers_set_len; |
50 ngx_array_t *headers_set; | 50 ngx_array_t *headers_set; |
51 ngx_hash_t headers_set_hash; | 51 ngx_hash_t headers_set_hash; |
52 | 52 |
53 ngx_array_t *headers_source; | 53 ngx_array_t *headers_source; |
54 ngx_array_t *headers_names; | |
55 | 54 |
56 ngx_array_t *proxy_lengths; | 55 ngx_array_t *proxy_lengths; |
57 ngx_array_t *proxy_values; | 56 ngx_array_t *proxy_values; |
58 | 57 |
59 ngx_array_t *redirects; | 58 ngx_array_t *redirects; |
2316 { | 2315 { |
2317 u_char *p; | 2316 u_char *p; |
2318 size_t size; | 2317 size_t size; |
2319 uintptr_t *code; | 2318 uintptr_t *code; |
2320 ngx_uint_t i; | 2319 ngx_uint_t i; |
2320 ngx_array_t headers_names; | |
2321 ngx_keyval_t *src, *s, *h; | 2321 ngx_keyval_t *src, *s, *h; |
2322 ngx_hash_key_t *hk; | 2322 ngx_hash_key_t *hk; |
2323 ngx_hash_init_t hash; | 2323 ngx_hash_init_t hash; |
2324 ngx_http_script_compile_t sc; | 2324 ngx_http_script_compile_t sc; |
2325 ngx_http_script_copy_code_t *copy; | 2325 ngx_http_script_copy_code_t *copy; |
2340 { | 2340 { |
2341 return NGX_OK; | 2341 return NGX_OK; |
2342 } | 2342 } |
2343 | 2343 |
2344 | 2344 |
2345 conf->headers_names = ngx_array_create(cf->pool, 4, sizeof(ngx_hash_key_t)); | 2345 if (ngx_array_init(&headers_names, cf->temp_pool, 4, sizeof(ngx_hash_key_t)) |
2346 if (conf->headers_names == NULL) { | 2346 != NGX_OK) |
2347 { | |
2347 return NGX_ERROR; | 2348 return NGX_ERROR; |
2348 } | 2349 } |
2349 | 2350 |
2350 if (conf->headers_source == NULL) { | 2351 if (conf->headers_source == NULL) { |
2351 conf->headers_source = ngx_array_create(cf->pool, 4, | 2352 conf->headers_source = ngx_array_create(cf->pool, 4, |
2402 | 2403 |
2403 | 2404 |
2404 src = conf->headers_source->elts; | 2405 src = conf->headers_source->elts; |
2405 for (i = 0; i < conf->headers_source->nelts; i++) { | 2406 for (i = 0; i < conf->headers_source->nelts; i++) { |
2406 | 2407 |
2407 hk = ngx_array_push(conf->headers_names); | 2408 hk = ngx_array_push(&headers_names); |
2408 if (hk == NULL) { | 2409 if (hk == NULL) { |
2409 return NGX_ERROR; | 2410 return NGX_ERROR; |
2410 } | 2411 } |
2411 | 2412 |
2412 hk->key = src[i].key; | 2413 hk->key = src[i].key; |
2550 hash.bucket_size = conf->headers_hash_bucket_size; | 2551 hash.bucket_size = conf->headers_hash_bucket_size; |
2551 hash.name = "proxy_headers_hash"; | 2552 hash.name = "proxy_headers_hash"; |
2552 hash.pool = cf->pool; | 2553 hash.pool = cf->pool; |
2553 hash.temp_pool = NULL; | 2554 hash.temp_pool = NULL; |
2554 | 2555 |
2555 if (ngx_hash_init(&hash, conf->headers_names->elts, | 2556 return ngx_hash_init(&hash, headers_names.elts, headers_names.nelts); |
2556 conf->headers_names->nelts) | |
2557 != NGX_OK) | |
2558 { | |
2559 return NGX_ERROR; | |
2560 } | |
2561 | |
2562 return NGX_OK; | |
2563 } | 2557 } |
2564 | 2558 |
2565 | 2559 |
2566 static char * | 2560 static char * |
2567 ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 2561 ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |