Skip to content

Commit

Permalink
Upstream keepalive: clearing of c->data in cached connections.
Browse files Browse the repository at this point in the history
Previously, connections returned from keepalive cache had c->data
pointing to the keepalive cache item.  While this shouldn't be a problem
for correct code, as c->data is not expected to be used before it is set,
explicitly clearing it might help to avoid confusion.
  • Loading branch information
mdounin committed Dec 5, 2019
1 parent d77ec54 commit 953f539
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http/modules/ngx_http_upstream_keepalive_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ ngx_http_upstream_get_keepalive_peer(ngx_peer_connection_t *pc, void *data)

c->idle = 0;
c->sent = 0;
c->data = NULL;
c->log = pc->log;
c->read->log = pc->log;
c->write->log = pc->log;
Expand Down

0 comments on commit 953f539

Please sign in to comment.