optimization

This commit is contained in:
Igor Sysoev 2007-10-10 13:58:47 +00:00
parent bfb23bf604
commit 47a1ebb050

View File

@ -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;