comparison src/http/ngx_http_upstream_round_robin.c @ 4952:3795aeb360fb stable-1.2

Merge of r4915, r4916, r4917: upstream minor fixes. *) Upstream: honor the "down" flag for a single server. If an upstream block was defined with the only server marked as "down", e.g. upstream u { server 127.0.0.1:8080 down; } an attempt was made to contact the server despite the "down" flag. It is believed that immediate 502 response is better in such a case, and it's also consistent with what is currently done in case of multiple servers all marked as "down". *) Upstream: better detection of connect() failures with kqueue. Pending EOF might be reported on both read and write events, whichever comes first, so check both of them. Patch by Yichun Zhang (agentzh), slightly modified.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 10 Dec 2012 16:35:32 +0000
parents 0141b4aec0e4
children ac3690ee6c28
comparison
equal deleted inserted replaced
4951:9ab61d17794f 4952:3795aeb360fb
428 pc->connection = NULL; 428 pc->connection = NULL;
429 429
430 if (rrp->peers->single) { 430 if (rrp->peers->single) {
431 peer = &rrp->peers->peer[0]; 431 peer = &rrp->peers->peer[0];
432 432
433 if (peer->down) {
434 goto failed;
435 }
436
433 } else { 437 } else {
434 438
435 /* there are several peers */ 439 /* there are several peers */
436 440
437 peer = ngx_http_upstream_get_peer(rrp); 441 peer = ngx_http_upstream_get_peer(rrp);