Skip to content

Commit

Permalink
fix a bug of segment fault when all the upstream servers are busy
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoweibin committed Aug 8, 2011
1 parent 273be4a commit 07c75b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ngx_tcp_session.c
Expand Up @@ -338,8 +338,7 @@ ngx_tcp_log_error(ngx_log_t *log, u_char *buf, size_t len)
return p;
}

p = ngx_snprintf(buf, len, ", server: %V",
s->addr_text);
p = ngx_snprintf(buf, len, ", server: %V", s->addr_text);
len -= p - buf;
buf = p;

Expand All @@ -349,7 +348,9 @@ ngx_tcp_log_error(ngx_log_t *log, u_char *buf, size_t len)
return p;
}

p = ngx_snprintf(buf, len, ", upstream: %V", pctx->upstream->name);
if (pctx->upstream->connection) {
p = ngx_snprintf(buf, len, ", upstream: %V", pctx->upstream->name);
}

return p;
}
Expand Down

0 comments on commit 07c75b0

Please sign in to comment.