diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-03-28 18:43:02 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-03-28 18:43:02 +0400 |
commit | c04deca88f2b3b99b615571b447d7ecbb6a79bee (patch) | |
tree | 79cedaf8b0e94ca35296e47fa7dd0d29a94bbda9 /src/http/ngx_http_upstream.c | |
parent | c4d120bb4378dbd1fbb9f1e2d7930feab6c2ecf2 (diff) |
nginx-0.1.27-RELEASE importrelease-0.1.27
*) Feature: the "blocked" parameter of the "valid_referers" directive.
*) Change: the errors while handling the request header now logged at
"info" level. The server name and the "Host" and "Referer" header
lines also logged.
*) Change: the "Host" header line is also logged in error log.
*) Feature: the proxy_pass_unparsed_uri directive. The special handling
of the "://" symbols in URI, appeared in 0.1.11 version, now is
canceled.
*) Bugfix: nginx could not be built on FreeBSD and Linux, if the
--without-ngx_http_auth_basic_module configuration parameter was
used.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r-- | src/http/ngx_http_upstream.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 0624c0f9a..89dee0e38 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1136,7 +1136,6 @@ ngx_http_upstream_log_error(ngx_log_t *log, u_char *buf, size_t len) { u_char *p; ngx_int_t escape; - ngx_str_t uri; ngx_http_log_ctx_t *ctx; ngx_http_request_t *r; ngx_http_upstream_t *u; @@ -1148,7 +1147,7 @@ ngx_http_upstream_log_error(ngx_log_t *log, u_char *buf, size_t len) peer = &u->peer; p = ngx_snprintf(buf, len, - " while %s, client: %V, host: %V, URL: \"%V\"," + " while %s, client: %V, server: %V, URL: \"%V\"," " upstream: %V%V%s%V", log->action, &r->connection->addr_text, @@ -1176,14 +1175,15 @@ ngx_http_upstream_log_error(ngx_log_t *log, u_char *buf, size_t len) r->uri.len - u->location->len, NGX_ESCAPE_URI); buf += r->uri.len - u->location->len + escape; + len -= r->uri.len - u->location->len + escape; - if (r->args.len == 0) { - return buf; + if (r->args.len) { + p = ngx_snprintf(buf, len, "?%V", &r->args); + len -= p - buf; + buf = p; } - len -= r->uri.len - u->location->len + escape; - - return ngx_snprintf(buf, len, "?%V", &r->args); + return ngx_http_log_error_info(r, buf, len); } p = ngx_palloc(r->pool, r->uri.len - u->location->len + escape); @@ -1194,17 +1194,23 @@ ngx_http_upstream_log_error(ngx_log_t *log, u_char *buf, size_t len) ngx_escape_uri(p, r->uri.data + u->location->len, r->uri.len - u->location->len, NGX_ESCAPE_URI); - uri.len = r->uri.len - u->location->len + escape; - uri.data = p; + p = ngx_cpymem(buf, p, r->uri.len - u->location->len + escape); } else { - uri.len = r->uri.len - u->location->len; - uri.data = r->uri.data + u->location->len; + p = ngx_cpymem(buf, r->uri.data + u->location->len, + r->uri.len - u->location->len); + } + + len -= p - buf; + buf = p; + if (r->args.len) { + p = ngx_snprintf(buf, len, "?%V", &r->args); + len -= p - buf; + buf = p; } - return ngx_snprintf(buf, len, "%V%s%V", - &uri, r->args.len ? "?" : "", &r->args); + return ngx_http_log_error_info(r, buf, len); } |