comparison src/http/modules/ngx_http_proxy_module.c @ 354:583decdb82a4 NGINX_0_6_21

nginx 0.6.21 *) Change: if variable values used in a "proxy_pass" directive contain IP-addresses only, then a "resolver" directive is not mandatory. resolver *) Bugfix: a segmentation fault might occur in worker process if a "proxy_pass" directive with URI-part was used; bug appeared in 0.6.19. *) Bugfix: if resolver was used on platform that does not support kqueue, then nginx issued an alert "name is out of response". Thanks to Andrei Nigmatulin. *) Bugfix: if the $server_protocol was used in FastCGI parameters and a request line length was near to the "client_header_buffer_size" directive value, then nginx issued an alert "fastcgi: the request record is too big". *) Bugfix: if a plain text HTTP/0.9 version request was made to HTTPS server, then nginx returned usual response.
author Igor Sysoev <http://sysoev.ru>
date Mon, 03 Dec 2007 00:00:00 +0300
parents 84b8345f70d5
children b743d290eb3b
comparison
equal deleted inserted replaced
353:4a470d9e2ea5 354:583decdb82a4
673 if (r->quoted_uri || r->internal) { 673 if (r->quoted_uri || r->internal) {
674 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len, 674 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len,
675 r->uri.len - loc_len, NGX_ESCAPE_URI); 675 r->uri.len - loc_len, NGX_ESCAPE_URI);
676 } 676 }
677 677
678 len += r->uri.len - loc_len + escape + sizeof("?") - 1 + r->args.len; 678 len += ctx->vars.uri.len + r->uri.len - loc_len + escape
679 + sizeof("?") - 1 + r->args.len;
679 } 680 }
680 681
681 ngx_http_script_flush_no_cacheable_variables(r, plcf->flushes); 682 ngx_http_script_flush_no_cacheable_variables(r, plcf->flushes);
682 683
683 if (plcf->body_set_len) { 684 if (plcf->body_set_len) {
2321 sc.lengths = &plcf->proxy_lengths; 2322 sc.lengths = &plcf->proxy_lengths;
2322 sc.values = &plcf->proxy_values; 2323 sc.values = &plcf->proxy_values;
2323 sc.variables = n; 2324 sc.variables = n;
2324 sc.complete_lengths = 1; 2325 sc.complete_lengths = 1;
2325 sc.complete_values = 1; 2326 sc.complete_values = 1;
2326 2327
2327 if (ngx_http_script_compile(&sc) != NGX_OK) { 2328 if (ngx_http_script_compile(&sc) != NGX_OK) {
2328 return NGX_CONF_ERROR; 2329 return NGX_CONF_ERROR;
2329 } 2330 }
2330 2331
2331 #if (NGX_HTTP_SSL) 2332 #if (NGX_HTTP_SSL)
2643 2644
2644 static ngx_int_t 2645 static ngx_int_t
2645 ngx_http_proxy_set_vars(ngx_pool_t *pool, ngx_url_t *u, 2646 ngx_http_proxy_set_vars(ngx_pool_t *pool, ngx_url_t *u,
2646 ngx_http_proxy_vars_t *v) 2647 ngx_http_proxy_vars_t *v)
2647 { 2648 {
2648 u_char *p;
2649
2650 if (!u->unix_socket) { 2649 if (!u->unix_socket) {
2651 if (u->no_port || u->port == u->default_port) { 2650 if (u->no_port || u->port == u->default_port) {
2652 v->host_header = u->host; 2651 v->host_header = u->host;
2653 2652
2654 if (u->default_port == 80) { 2653 if (u->default_port == 80) {
2659 v->port.len = sizeof("443") - 1; 2658 v->port.len = sizeof("443") - 1;
2660 v->port.data = (u_char *) "443"; 2659 v->port.data = (u_char *) "443";
2661 } 2660 }
2662 2661
2663 } else { 2662 } else {
2664 p = ngx_palloc(pool, u->host.len + sizeof(":65536") - 1); 2663 v->host_header.len = u->host.len + 1 + u->port_text.len;
2665 if (p == NULL) { 2664 v->host_header.data = u->host.data;
2666 return NGX_ERROR; 2665 v->port = u->port_text;
2667 }
2668
2669 v->host_header.len = ngx_sprintf(p, "%V:%d", &u->host, u->port) - p;
2670 v->host_header.data = p;
2671
2672 v->port.len = v->host_header.len - u->host.len - 1;
2673 v->port.data = p + u->host.len + 1;
2674 } 2666 }
2675 2667
2676 } else { 2668 } else {
2677 v->host_header.len = sizeof("localhost") - 1; 2669 v->host_header.len = sizeof("localhost") - 1;
2678 v->host_header.data = (u_char *) "localhost"; 2670 v->host_header.data = (u_char *) "localhost";