From 335998961b08c7f7ec6f658262b795d7cebf092f Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Mon, 4 Jun 2012 00:00:28 +0000 Subject: [PATCH] Upstream: least_conn compilation fixes. Removed duplicate call of ngx_http_upstream_init_round_robin_peer() overlooked during code changes. Rewritten "return lcp->free_rr_peer(...)" as MSVC doesn't like it. --- src/http/modules/ngx_http_upstream_least_conn_module.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/http/modules/ngx_http_upstream_least_conn_module.c b/src/http/modules/ngx_http_upstream_least_conn_module.c index bc9a14621..50e68b21b 100644 --- a/src/http/modules/ngx_http_upstream_least_conn_module.c +++ b/src/http/modules/ngx_http_upstream_least_conn_module.c @@ -122,7 +122,6 @@ static ngx_int_t ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r, ngx_http_upstream_srv_conf_t *us) { - ngx_int_t rc; ngx_http_upstream_lc_peer_data_t *lcp; ngx_http_upstream_least_conn_conf_t *lcf; @@ -141,8 +140,6 @@ ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r, r->upstream->peer.data = &lcp->rrp; - rc = ngx_http_upstream_init_round_robin_peer(r, us); - if (ngx_http_upstream_init_round_robin_peer(r, us) != NGX_OK) { return NGX_ERROR; } @@ -350,7 +347,8 @@ ngx_http_upstream_free_least_conn_peer(ngx_peer_connection_t *pc, "free least conn peer %ui %ui", pc->tries, state); if (lcp->rrp.peers->single) { - return lcp->free_rr_peer(pc, &lcp->rrp, state); + lcp->free_rr_peer(pc, &lcp->rrp, state); + return; } if (state == 0 && pc->tries == 0) { @@ -359,7 +357,7 @@ ngx_http_upstream_free_least_conn_peer(ngx_peer_connection_t *pc, lcp->conns[lcp->rrp.current]--; - return lcp->free_rr_peer(pc, &lcp->rrp, state); + lcp->free_rr_peer(pc, &lcp->rrp, state); }