diff --git a/lib/connect.c b/lib/connect.c index 5f64afab3552c08529de880a3a41364de178ac76..3be4918953535c0902f44109aad50a6cfa51b606 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -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; } diff --git a/lib/multi.c b/lib/multi.c index 6313ba4aeb088774857b77e67f1299638c6fa5fb..7ea366ca2ebb34159664240487bb50e8ca91e992 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2115,7 +2115,7 @@ static void singlesocket(struct Curl_multi *multi, * Curl_multi_closed() * * Used by the connect code to tell the multi_socket code that one of the - * sockets we were using have just been closed. This function will then + * sockets we were using is about to be closed. This function will then * remove it from the sockethash for this handle to make the multi_socket API * behave properly, especially for the case when libcurl will create another * socket again and it gets the same file descriptor number. diff --git a/lib/multiif.h b/lib/multiif.h index 19bdaf2a3c6d1897d019f11471f5c2cc18c75c11..d8acfcabe7ce79b490193c8ab9a9cb78c5b482d7 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -82,7 +82,7 @@ size_t Curl_multi_max_total_connections(struct Curl_multi *multi); * Curl_multi_closed() * * Used by the connect code to tell the multi_socket code that one of the - * sockets we were using have just been closed. This function will then + * sockets we were using is about to be closed. This function will then * remove it from the sockethash for this handle to make the multi_socket API * behave properly, especially for the case when libcurl will create another * socket again and it gets the same file descriptor number.