optimization
This commit is contained in:
parent
b8baad1936
commit
1a344ced38
1 changed files with 7 additions and 10 deletions
|
@ -167,17 +167,14 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
|
|||
peers->number = n;
|
||||
peers->name = &us->host;
|
||||
|
||||
n = 0;
|
||||
|
||||
for (i = 0; i < u.naddrs; i++) {
|
||||
peers->peer[n].sockaddr = u.addrs[i].sockaddr;
|
||||
peers->peer[n].socklen = u.addrs[i].socklen;
|
||||
peers->peer[n].name = u.addrs[i].name;
|
||||
peers->peer[n].weight = 1;
|
||||
peers->peer[n].current_weight = 1;
|
||||
peers->peer[n].max_fails = 1;
|
||||
peers->peer[n].fail_timeout = 10;
|
||||
n++;
|
||||
peers->peer[i].sockaddr = u.addrs[i].sockaddr;
|
||||
peers->peer[i].socklen = u.addrs[i].socklen;
|
||||
peers->peer[i].name = u.addrs[i].name;
|
||||
peers->peer[i].weight = 1;
|
||||
peers->peer[i].current_weight = 1;
|
||||
peers->peer[i].max_fails = 1;
|
||||
peers->peer[i].fail_timeout = 10;
|
||||
}
|
||||
|
||||
us->peer.data = peers;
|
||||
|
|
Loading…
Reference in a new issue