CLOSESOCKETFUNCTION: added

Introduced the initial setup to allow closesocket callbacks by making
sure sclose() is only ever called from one place in the libcurl source
and still run all test cases fine.
This commit is contained in:
Daniel Stenberg
2011-05-16 23:46:43 +02:00
parent d4e000906a
commit b5d170b551
10 changed files with 71 additions and 25 deletions

View File

@@ -2185,7 +2185,7 @@ static CURLcode Curl_do_perform(struct SessionHandle *data)
if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) {
/* if we failed anywhere, we must clean up the secondary socket if
it was used */
sclose(conn->sock[SECONDARYSOCKET]);
Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]);
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
}
}