mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 10:33:15 +00:00
[MSAFD] Don't update shared state on close if we still have active references to the socket. Checked also by ws2_32:close API test CORE-12029
svn path=/trunk/; revision=74673
This commit is contained in:
parent
1c9d856e91
commit
fb1a1ab85e
1 changed files with 4 additions and 3 deletions
|
@ -677,15 +677,16 @@ WSPCloseSocket(IN SOCKET Handle,
|
|||
if (lpErrno) *lpErrno = WSAENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
/* Set the state to close */
|
||||
OldState = Socket->SharedData->State;
|
||||
Socket->SharedData->State = SocketClosed;
|
||||
|
||||
/* Decrement reference count on SharedData */
|
||||
References = InterlockedDecrement(&Socket->SharedData->RefCount);
|
||||
if (References)
|
||||
goto ok;
|
||||
|
||||
/* Set the state to close */
|
||||
OldState = Socket->SharedData->State;
|
||||
Socket->SharedData->State = SocketClosed;
|
||||
|
||||
/* If SO_LINGER is ON and the Socket is connected, we need to disconnect */
|
||||
/* FIXME: Should we do this on Datagram Sockets too? */
|
||||
if ((OldState == SocketConnected) && (Socket->SharedData->LingerData.l_onoff))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue