diff options
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -2058,6 +2058,9 @@ static void conn_free(struct connectdata *conn) if(CURL_SOCKET_BAD != conn->sock[FIRSTSOCKET]) sclose(conn->sock[FIRSTSOCKET]); + if (conn->data->reqdata.current_conn == conn) { + conn->data->reqdata.current_conn = NULL; + } Curl_safefree(conn->user); Curl_safefree(conn->passwd); Curl_safefree(conn->proxyuser); @@ -4514,3 +4517,16 @@ CURLcode Curl_do_more(struct connectdata *conn) return result; } + +/* Called on connect, and if there's already a protocol-specific struct + allocated for a different connection, this frees it that it can be setup + properly later on. */ +void Curl_reset_reqproto(struct connectdata *conn) +{ + struct SessionHandle *data = conn->data; + if (data->reqdata.proto.generic && data->reqdata.current_conn != conn) { + free(data->reqdata.proto.generic); + data->reqdata.proto.generic = NULL; + } + data->reqdata.current_conn = conn; +} |