comparison src/http/modules/ngx_http_proxy_module.c @ 570:8246d8a2c2be NGINX_0_8_37

nginx 0.8.37 *) Feature: the ngx_http_split_clients_module. *) Feature: the "map" directive supports keys more than 255 characters. *) Bugfix: nginx ignored the "private" and "no-store" values in the "Cache-Control" backend response header line. *) Bugfix: a "stub" parameter of an "include" SSI directive was not used, if empty response has 200 status code. *) Bugfix: if a proxied or FastCGI request was internally redirected to another proxied or FastCGI location, then a segmentation fault might occur in a worker process; the bug had appeared in 0.8.33. Thanks to Yichun Zhang. *) Bugfix: IMAP connections may hang until they timed out while talking to Zimbra server. Thanks to Alan Batie.
author Igor Sysoev <http://sysoev.ru>
date Mon, 17 May 2010 00:00:00 +0400
parents be4f34123024
children ff463db0be31
comparison
equal deleted inserted replaced
569:19b134bf21c0 570:8246d8a2c2be
1566 } 1566 }
1567 1567
1568 h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash( 1568 h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash(
1569 ngx_hash('s', 'e'), 'r'), 'v'), 'e'), 'r'); 1569 ngx_hash('s', 'e'), 'r'), 'v'), 'e'), 'r');
1570 1570
1571 h->key.len = sizeof("Server") - 1; 1571 ngx_str_set(&h->key, "Server");
1572 h->key.data = (u_char *) "Server"; 1572 ngx_str_null(&h->value);
1573 h->value.len = 0;
1574 h->value.data = NULL;
1575 h->lowcase_key = (u_char *) "server"; 1573 h->lowcase_key = (u_char *) "server";
1576 } 1574 }
1577 1575
1578 if (r->upstream->headers_in.date == NULL) { 1576 if (r->upstream->headers_in.date == NULL) {
1579 h = ngx_list_push(&r->upstream->headers_in.headers); 1577 h = ngx_list_push(&r->upstream->headers_in.headers);
1581 return NGX_ERROR; 1579 return NGX_ERROR;
1582 } 1580 }
1583 1581
1584 h->hash = ngx_hash(ngx_hash(ngx_hash('d', 'a'), 't'), 'e'); 1582 h->hash = ngx_hash(ngx_hash(ngx_hash('d', 'a'), 't'), 'e');
1585 1583
1586 h->key.len = sizeof("Date") - 1; 1584 ngx_str_set(&h->key, "Date");
1587 h->key.data = (u_char *) "Date"; 1585 ngx_str_null(&h->value);
1588 h->value.len = 0;
1589 h->value.data = NULL;
1590 h->lowcase_key = (u_char *) "date"; 1586 h->lowcase_key = (u_char *) "date";
1591 } 1587 }
1592 1588
1593 return NGX_OK; 1589 return NGX_OK;
1594 } 1590 }
2220 2216
2221 if (conf->vars.uri.len) { 2217 if (conf->vars.uri.len) {
2222 pr->replacement.text = conf->location; 2218 pr->replacement.text = conf->location;
2223 2219
2224 } else { 2220 } else {
2225 pr->replacement.text.len = 0; 2221 ngx_str_null(&pr->replacement.text);
2226 pr->replacement.text.data = NULL;
2227 } 2222 }
2228 } 2223 }
2229 } 2224 }
2230 2225
2231 /* STUB */ 2226 /* STUB */
2309 s = ngx_array_push(conf->headers_source); 2304 s = ngx_array_push(conf->headers_source);
2310 if (s == NULL) { 2305 if (s == NULL) {
2311 return NGX_CONF_ERROR; 2306 return NGX_CONF_ERROR;
2312 } 2307 }
2313 2308
2314 s->key.len = sizeof("Content-Length") - 1; 2309 ngx_str_set(&s->key, "Content-Length");
2315 s->key.data = (u_char *) "Content-Length"; 2310 ngx_str_set(&s->value, "$proxy_internal_body_length");
2316 s->value.len = sizeof("$proxy_internal_body_length") - 1;
2317 s->value.data = (u_char *) "$proxy_internal_body_length";
2318 } 2311 }
2319 2312
2320 if (ngx_http_proxy_merge_headers(cf, conf, prev) != NGX_OK) { 2313 if (ngx_http_proxy_merge_headers(cf, conf, prev) != NGX_OK) {
2321 return NGX_CONF_ERROR; 2314 return NGX_CONF_ERROR;
2322 } 2315 }
2775 2768
2776 if (plcf->vars.uri.len) { 2769 if (plcf->vars.uri.len) {
2777 pr->replacement.text = plcf->location; 2770 pr->replacement.text = plcf->location;
2778 2771
2779 } else { 2772 } else {
2780 pr->replacement.text.len = 0; 2773 ngx_str_null(&pr->replacement.text);
2781 pr->replacement.text.data = NULL;
2782 } 2774 }
2783 2775
2784 return NGX_CONF_OK; 2776 return NGX_CONF_OK;
2785 } 2777 }
2786 2778
3036 if (u->no_port || u->port == u->default_port) { 3028 if (u->no_port || u->port == u->default_port) {
3037 3029
3038 v->host_header = u->host; 3030 v->host_header = u->host;
3039 3031
3040 if (u->default_port == 80) { 3032 if (u->default_port == 80) {
3041 v->port.len = sizeof("80") - 1; 3033 ngx_str_set(&v->port, "80");
3042 v->port.data = (u_char *) "80";
3043 3034
3044 } else { 3035 } else {
3045 v->port.len = sizeof("443") - 1; 3036 ngx_str_set(&v->port, "443");
3046 v->port.data = (u_char *) "443";
3047 } 3037 }
3048 3038
3049 } else { 3039 } else {
3050 v->host_header.len = u->host.len + 1 + u->port_text.len; 3040 v->host_header.len = u->host.len + 1 + u->port_text.len;
3051 v->host_header.data = u->host.data; 3041 v->host_header.data = u->host.data;
3053 } 3043 }
3054 3044
3055 v->key_start.len += v->host_header.len; 3045 v->key_start.len += v->host_header.len;
3056 3046
3057 } else { 3047 } else {
3058 v->host_header.len = sizeof("localhost") - 1; 3048 ngx_str_set(&v->host_header, "localhost");
3059 v->host_header.data = (u_char *) "localhost"; 3049 ngx_str_null(&v->port);
3060 v->port.len = 0;
3061 v->port.data = (u_char *) "";
3062 v->key_start.len += sizeof("unix:") - 1 + u->host.len + 1; 3050 v->key_start.len += sizeof("unix:") - 1 + u->host.len + 1;
3063 } 3051 }
3064 3052
3065 v->uri = u->uri; 3053 v->uri = u->uri;
3066 } 3054 }