diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-01-11 23:43:38 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-01-11 23:44:28 +0100 |
commit | 73566cd850532c964d4ead25c86eb4d4b8d89bba (patch) | |
tree | a754baddba20fc9b3fdab77dbe2c00c727f8833f | |
parent | 52e27fe9c6421d36337c0b69df6ca2b3b2d72613 (diff) | |
download | curl-73566cd850532c964d4ead25c86eb4d4b8d89bba.tar.gz |
extract_if_dead: use a known working transfer when checking connectionsbagder/set-transfer-for-conn
Make sure that this function sets a proper "live" transfer for the
connection before calling the protocol-specific connection check
function, and then clear it again afterward as a non-used connection has
no current transfer.
Fixes #3463
-rw-r--r-- | lib/url.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -965,8 +965,9 @@ static bool extract_if_dead(struct connectdata *conn, /* The protocol has a special method for checking the state of the connection. Use it to check if the connection is dead. */ unsigned int state; - + conn->data = data; /* temporary transfer for this connection to use */ state = conn->handler->connection_check(conn, CONNCHECK_ISDEAD); + conn->data = NULL; /* clear transfer again */ dead = (state & CONNRESULT_DEAD); } else { @@ -3773,7 +3774,6 @@ static CURLcode create_conn(struct Curl_easy *data, /* Setup a "faked" transfer that'll do nothing */ if(!result) { - conn->data = data; conn->bits.tcpconnect[FIRSTSOCKET] = TRUE; /* we are "connected */ result = Curl_conncache_add_conn(data->state.conn_cache, conn); |