mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[MSAFD]
- Mark the accepted socket as connected - Fixes graceful disconnect on accepted sockets svn path=/trunk/; revision=52389
This commit is contained in:
parent
ae4e935c92
commit
fb1a75454e
1 changed files with 12 additions and 0 deletions
|
@ -1047,6 +1047,7 @@ WSPAccept(SOCKET Handle,
|
|||
ULONG CallBack;
|
||||
WSAPROTOCOL_INFOW ProtocolInfo;
|
||||
SOCKET AcceptSocket;
|
||||
PSOCKET_INFORMATION AcceptSocketInfo;
|
||||
UCHAR ReceiveBuffer[0x1A];
|
||||
HANDLE SockEvent;
|
||||
|
||||
|
@ -1362,6 +1363,17 @@ WSPAccept(SOCKET Handle,
|
|||
MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
AcceptSocketInfo = GetSocketStructure(AcceptSocket);
|
||||
if (!AcceptSocketInfo)
|
||||
{
|
||||
NtClose(SockEvent);
|
||||
WSPCloseSocket( AcceptSocket, lpErrno );
|
||||
MsafdReturnWithErrno( STATUS_INVALID_CONNECTION, lpErrno, 0, NULL );
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
AcceptSocketInfo->SharedData.State = SocketConnected;
|
||||
|
||||
/* Return Address in SOCKADDR FORMAT */
|
||||
if( SocketAddress )
|
||||
|
|
Loading…
Reference in a new issue