Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 884:4d68c486fcb0
upstream choice modules
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 04 Dec 2006 16:46:13 +0000 |
parents | 7521e5f5d555 |
children | 49d03c183ad2 |
comparison
equal
deleted
inserted
replaced
883:eac23634d614 | 884:4d68c486fcb0 |
---|---|
2407 | 2407 |
2408 static u_char * | 2408 static u_char * |
2409 ngx_http_log_error_handler(ngx_http_request_t *r, ngx_http_request_t *sr, | 2409 ngx_http_log_error_handler(ngx_http_request_t *r, ngx_http_request_t *sr, |
2410 u_char *buf, size_t len) | 2410 u_char *buf, size_t len) |
2411 { | 2411 { |
2412 u_char *p; | 2412 char *uri_separator; |
2413 ngx_http_upstream_t *u; | 2413 u_char *p; |
2414 ngx_peer_connection_t *peer; | 2414 ngx_http_upstream_t *u; |
2415 | 2415 |
2416 if (r->server_name.data) { | 2416 if (r->server_name.data) { |
2417 p = ngx_snprintf(buf, len, ", server: %V", &r->server_name); | 2417 p = ngx_snprintf(buf, len, ", server: %V", &r->server_name); |
2418 len -= p - buf; | 2418 len -= p - buf; |
2419 buf = p; | 2419 buf = p; |
2449 buf = p; | 2449 buf = p; |
2450 } | 2450 } |
2451 | 2451 |
2452 u = sr->upstream; | 2452 u = sr->upstream; |
2453 | 2453 |
2454 if (u) { | 2454 if (u && u->peer.name) { |
2455 peer = &u->peer; | 2455 |
2456 uri_separator = ""; | |
2457 | |
2458 #if (NGX_HAVE_UNIX_DOMAIN) | |
2459 if (u->peer.sockaddr && u->peer.sockaddr->sa_family == AF_UNIX) { | |
2460 uri_separator = ":"; | |
2461 } | |
2462 #endif | |
2456 | 2463 |
2457 p = ngx_snprintf(buf, len, ", upstream: \"%V%V%s%V\"", | 2464 p = ngx_snprintf(buf, len, ", upstream: \"%V%V%s%V\"", |
2458 &u->conf->schema, | 2465 &u->conf->schema, u->peer.name, |
2459 &peer->peers->peer[peer->cur_peer].name, | 2466 uri_separator, &u->uri); |
2460 peer->peers->peer[peer->cur_peer].uri_separator, | |
2461 &u->uri); | |
2462 len -= p - buf; | 2467 len -= p - buf; |
2463 buf = p; | 2468 buf = p; |
2464 } | 2469 } |
2465 | 2470 |
2466 if (r->headers_in.host) { | 2471 if (r->headers_in.host) { |