mirror of
https://github.com/curl/curl.git
synced 2026-08-25 22:53:38 +03:00
easy: during upkeep, attach Curl_easy to connections in the cache
During the protocol-specific parts of connection upkeep, some code assumes that the data->conn pointer already is set correctly. However, there's currently no guarantee of that in the code. This fix temporarily attaches each connection to the Curl_easy object before performing the protocol-specific connection check on it, in a similar manner to the connection checking in extract_if_dead(). Fixes #7386 Closes #7387 Reported-by: Josie Huddleston
This commit is contained in:
parent
de1004eb0f
commit
c12ad2d4e8
1 changed files with 8 additions and 1 deletions
|
|
@ -1213,9 +1213,16 @@ static int conn_upkeep(struct Curl_easy *data,
|
||||||
/* Param is unused. */
|
/* Param is unused. */
|
||||||
(void)param;
|
(void)param;
|
||||||
|
|
||||||
if(conn->handler->connection_check)
|
if(conn->handler->connection_check) {
|
||||||
|
/* briefly attach the connection to this transfer for the purpose of
|
||||||
|
checking it */
|
||||||
|
Curl_attach_connnection(data, conn);
|
||||||
|
|
||||||
/* Do a protocol-specific keepalive check on the connection. */
|
/* Do a protocol-specific keepalive check on the connection. */
|
||||||
conn->handler->connection_check(data, conn, CONNCHECK_KEEPALIVE);
|
conn->handler->connection_check(data, conn, CONNCHECK_KEEPALIVE);
|
||||||
|
/* detach the connection again */
|
||||||
|
Curl_detach_connnection(data);
|
||||||
|
}
|
||||||
|
|
||||||
return 0; /* continue iteration */
|
return 0; /* continue iteration */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue