comparison src/http/ngx_http_upstream.c @ 104:146eff53ab60 NGINX_0_2_6

nginx 0.2.6 *) Change: while using load-balancing the time before the failed backend retry was decreased from 60 to 10 seconds. *) Change: the "proxy_pass_unparsed_uri" was canceled, the original URI now passed, if the URI part is omitted in "proxy_pass" directive. *) Feature: the "error_page" directive supports redirects and allows more flexible to change an error code. *) Change: the charset in the "Content-Type" header line now is ignored in proxied subrequests. *) Bugfix: if the URI was changed in the "if" block and request did not found new configuration, then the ngx_http_rewrite_module rules ran again. *) Bugfix: if the "set" directive set the ngx_http_geo_module variable in some configuration part, the this variable was not available in other configuration parts and the "using uninitialized variable" error was occurred; bug appeared in 0.2.2.
author Igor Sysoev <http://sysoev.ru>
date Wed, 05 Oct 2005 00:00:00 +0400
parents f63280c59dd5
children dad2fe8ecf08
comparison
equal deleted inserted replaced
103:acdd83ee07cb 104:146eff53ab60
1791 1791
1792 static u_char * 1792 static u_char *
1793 ngx_http_upstream_log_error(ngx_http_request_t *r, u_char *buf, size_t len) 1793 ngx_http_upstream_log_error(ngx_http_request_t *r, u_char *buf, size_t len)
1794 { 1794 {
1795 u_char *p; 1795 u_char *p;
1796 ngx_str_t line;
1797 uintptr_t escape;
1798 ngx_http_upstream_t *u; 1796 ngx_http_upstream_t *u;
1799 ngx_peer_connection_t *peer; 1797 ngx_peer_connection_t *peer;
1800 1798
1801 u = r->upstream; 1799 u = r->upstream;
1802 peer = &u->peer; 1800 peer = &u->peer;
1807 &r->server_name, 1805 &r->server_name,
1808 &r->unparsed_uri, 1806 &r->unparsed_uri,
1809 &u->conf->schema, 1807 &u->conf->schema,
1810 &peer->peers->peer[peer->cur_peer].name, 1808 &peer->peers->peer[peer->cur_peer].name,
1811 peer->peers->peer[peer->cur_peer].uri_separator, 1809 peer->peers->peer[peer->cur_peer].uri_separator,
1812 &u->conf->uri); 1810 &u->uri);
1813 len -= p - buf; 1811 len -= p - buf;
1814 buf = p; 1812 buf = p;
1815
1816 if (r->quoted_uri) {
1817 escape = 2 * ngx_escape_uri(NULL, r->uri.data + u->conf->location->len,
1818 r->uri.len - u->conf->location->len,
1819 NGX_ESCAPE_URI);
1820 } else {
1821 escape = 0;
1822 }
1823
1824 if (escape) {
1825 if (len >= r->uri.len - u->conf->location->len + escape) {
1826
1827 ngx_escape_uri(buf, r->uri.data + u->conf->location->len,
1828 r->uri.len - u->conf->location->len, NGX_ESCAPE_URI);
1829
1830 buf += r->uri.len - u->conf->location->len + escape;
1831 len -= r->uri.len - u->conf->location->len + escape;
1832
1833 } else {
1834 p = ngx_palloc(r->pool,
1835 r->uri.len - u->conf->location->len + escape);
1836 if (p == NULL) {
1837 return buf;
1838 }
1839
1840 ngx_escape_uri(p, r->uri.data + u->conf->location->len,
1841 r->uri.len - u->conf->location->len, NGX_ESCAPE_URI);
1842
1843 line.len = len;
1844 line.data = p;
1845
1846 return ngx_snprintf(buf, len, "%V", &line);
1847 }
1848
1849 } else {
1850 line.len = r->uri.len - u->conf->location->len;
1851 if (line.len > len) {
1852 line.len = len;
1853 }
1854
1855 line.data = r->uri.data + u->conf->location->len;
1856 p = ngx_snprintf(buf, len, "%V", &line);
1857
1858 len -= p - buf;
1859 buf = p;
1860 }
1861
1862 if (r->args.len) {
1863 p = ngx_snprintf(buf, len, "?%V", &r->args);
1864 len -= p - buf;
1865 buf = p;
1866 }
1867 1813
1868 return ngx_http_log_error_info(r, buf, len); 1814 return ngx_http_log_error_info(r, buf, len);
1869 } 1815 }
1870 1816
1871 1817