Curl_closesocket: clear sock_accepted on close
As a follow-up from commit d5b5f64bce
, clear the sock_accepted status
when such a socket is closed to avoid a re-used connection to retain the
state wrongly.
Bug: http://curl.haxx.se/mail/lib-2011-12/0079.html
This commit is contained in:
parent
9dbe6565d4
commit
1cacf853da
@ -1111,10 +1111,13 @@ int Curl_closesocket(struct connectdata *conn,
|
|||||||
curl_socket_t sock)
|
curl_socket_t sock)
|
||||||
{
|
{
|
||||||
if(conn && conn->fclosesocket) {
|
if(conn && conn->fclosesocket) {
|
||||||
if((sock != conn->sock[SECONDARYSOCKET]) ||
|
if((sock == conn->sock[SECONDARYSOCKET]) &&
|
||||||
!conn->sock_accepted[SECONDARYSOCKET])
|
conn->sock_accepted[SECONDARYSOCKET])
|
||||||
/* if this socket matches the second socket, and that was created with
|
/* if this socket matches the second socket, and that was created with
|
||||||
accept, then we MUST NOT call the callback */
|
accept, then we MUST NOT call the callback but clear the accepted
|
||||||
|
status */
|
||||||
|
conn->sock_accepted[SECONDARYSOCKET] = FALSE;
|
||||||
|
else
|
||||||
return conn->fclosesocket(conn->closesocket_client, sock);
|
return conn->fclosesocket(conn->closesocket_client, sock);
|
||||||
}
|
}
|
||||||
return sclose(sock);
|
return sclose(sock);
|
||||||
|
Loading…
Reference in New Issue
Block a user