mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:03:32 +03:00
multi: inform about closed sockets before they are closed
When the connection code decides to close a socket it informs the multi system via the Curl_multi_closed function. The multi system may, in turn, invoke the CURLMOPT_SOCKETFUNCTION function with CURL_POLL_REMOVE. This happens after the socket has already been closed. Reorder the code so that CURL_POLL_REMOVE is called before the socket is closed.
This commit is contained in:
parent
cf510ad781
commit
2933698677
3 changed files with 4 additions and 3 deletions
|
|
@ -1244,12 +1244,13 @@ int Curl_closesocket(struct connectdata *conn,
|
|||
else
|
||||
return conn->fclosesocket(conn->closesocket_client, sock);
|
||||
}
|
||||
sclose(sock);
|
||||
|
||||
if(conn)
|
||||
/* tell the multi-socket code about this */
|
||||
Curl_multi_closed(conn, sock);
|
||||
|
||||
sclose(sock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue