comparison src/http/modules/ngx_http_fastcgi_module.c @ 578:bc110f60c0de NGINX_0_8_41

nginx 0.8.41 *) Security: nginx/Windows worker might be terminated abnormally if a requested file name has invalid UTF-8 encoding. *) Change: now nginx allows to use spaces in a request line. *) Bugfix: the "proxy_redirect" directive changed incorrectly a backend "Refresh" response header line. Thanks to Andrey Andreew and Max Sogin. *) Bugfix: nginx did not support path without host name in "Destination" request header line.
author Igor Sysoev <http://sysoev.ru>
date Tue, 15 Jun 2010 00:00:00 +0400
parents 01f2313e34f1
children 016632f0fb18
comparison
equal deleted inserted replaced
577:dd4c3325a56f 578:bc110f60c0de
626 626
627 627
628 static ngx_int_t 628 static ngx_int_t
629 ngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf) 629 ngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)
630 { 630 {
631 ngx_url_t u; 631 ngx_url_t url;
632 632 ngx_http_upstream_t *u;
633 ngx_memzero(&u, sizeof(ngx_url_t)); 633
634 634 ngx_memzero(&url, sizeof(ngx_url_t));
635 if (ngx_http_script_run(r, &u.url, flcf->fastcgi_lengths->elts, 0, 635
636 if (ngx_http_script_run(r, &url.url, flcf->fastcgi_lengths->elts, 0,
636 flcf->fastcgi_values->elts) 637 flcf->fastcgi_values->elts)
637 == NULL) 638 == NULL)
638 { 639 {
639 return NGX_ERROR; 640 return NGX_ERROR;
640 } 641 }
641 642
642 u.no_resolve = 1; 643 url.no_resolve = 1;
643 644
644 if (ngx_parse_url(r->pool, &u) != NGX_OK) { 645 if (ngx_parse_url(r->pool, &url) != NGX_OK) {
645 if (u.err) { 646 if (url.err) {
646 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 647 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
647 "%s in upstream \"%V\"", u.err, &u.url); 648 "%s in upstream \"%V\"", url.err, &url.url);
648 } 649 }
649 650
650 return NGX_ERROR; 651 return NGX_ERROR;
651 } 652 }
652 653
653 if (u.no_port) { 654 if (url.no_port) {
654 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 655 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
655 "no port in upstream \"%V\"", &u.url); 656 "no port in upstream \"%V\"", &url.url);
656 return NGX_ERROR; 657 return NGX_ERROR;
657 } 658 }
658 659
659 r->upstream->resolved = ngx_pcalloc(r->pool, 660 u = r->upstream;
660 sizeof(ngx_http_upstream_resolved_t)); 661
661 if (r->upstream->resolved == NULL) { 662 u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
663 if (u->resolved == NULL) {
662 return NGX_ERROR; 664 return NGX_ERROR;
663 } 665 }
664 666
665 if (u.addrs && u.addrs[0].sockaddr) { 667 if (url.addrs && url.addrs[0].sockaddr) {
666 r->upstream->resolved->sockaddr = u.addrs[0].sockaddr; 668 u->resolved->sockaddr = url.addrs[0].sockaddr;
667 r->upstream->resolved->socklen = u.addrs[0].socklen; 669 u->resolved->socklen = url.addrs[0].socklen;
668 r->upstream->resolved->naddrs = 1; 670 u->resolved->naddrs = 1;
669 r->upstream->resolved->host = u.addrs[0].name; 671 u->resolved->host = url.addrs[0].name;
670 672
671 } else { 673 } else {
672 r->upstream->resolved->host = u.host; 674 u->resolved->host = url.host;
673 r->upstream->resolved->port = u.port; 675 u->resolved->port = url.port;
674 } 676 }
675 677
676 return NGX_OK; 678 return NGX_OK;
677 } 679 }
678 680