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:
Max Romanov
2020-09-30 16:36:57 +03:00
parent 153e8a8779
commit c5cb2432c4

View File

@@ -503,7 +503,10 @@ nxt_h1p_conn_request_init(nxt_task_t *task, void *obj, void *data)
joint->count++;
r->conf = joint;
if (c->local == NULL) {
c->local = joint->socket_conf->sockaddr;
}
nxt_h1p_conn_request_header_parse(task, c, h1p);
return;