Fixing router connection pool leakage.
The connection's local socket address is allocated from the connection pool before the request is passed to the application; however, with keep-alive connections, this field was unconditionally reset by a socket configuration value that could be NULL. For the next request, the address was allocated again from the same connection pool. Nonetheless, all leaked addresses were released when the connection was closed. The issue introduced in changeset 5c7dd85fabd5.
This commit is contained in:
@@ -503,7 +503,10 @@ nxt_h1p_conn_request_init(nxt_task_t *task, void *obj, void *data)
|
||||
joint->count++;
|
||||
|
||||
r->conf = joint;
|
||||
c->local = joint->socket_conf->sockaddr;
|
||||
|
||||
if (c->local == NULL) {
|
||||
c->local = joint->socket_conf->sockaddr;
|
||||
}
|
||||
|
||||
nxt_h1p_conn_request_header_parse(task, c, h1p);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user