Skip to content

Commit

Permalink
Merge pull request alibaba#279 from chobits/master
Browse files Browse the repository at this point in the history
round robin: optimize loop in ngx_http_upstream_init_round_robin()
  • Loading branch information
yaoweibin committed Jul 28, 2013
2 parents 3fcc0ad + f3e7954 commit ff9004d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/http/ngx_http_upstream_round_robin.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
n = 0;

for (i = 0; i < us->servers->nelts; i++) {
for (j = 0; j < server[i].naddrs; j++) {
if (server[i].backup) {
continue;
}
if (server[i].backup) {
continue;
}

for (j = 0; j < server[i].naddrs; j++) {
peers->peer[n].sockaddr = server[i].addrs[j].sockaddr;
peers->peer[n].socklen = server[i].addrs[j].socklen;
peers->peer[n].name = server[i].addrs[j].name;
Expand Down Expand Up @@ -143,11 +143,11 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
n = 0;

for (i = 0; i < us->servers->nelts; i++) {
for (j = 0; j < server[i].naddrs; j++) {
if (!server[i].backup) {
continue;
}
if (!server[i].backup) {
continue;
}

for (j = 0; j < server[i].naddrs; j++) {
backup->peer[n].sockaddr = server[i].addrs[j].sockaddr;
backup->peer[n].socklen = server[i].addrs[j].socklen;
backup->peer[n].name = server[i].addrs[j].name;
Expand Down

0 comments on commit ff9004d

Please sign in to comment.