mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[IP]
- Don't try to close the connection again if it has already been terminated by the remote peer svn path=/trunk/; revision=47007
This commit is contained in:
parent
d35aa96218
commit
740cd5ef90
1 changed files with 17 additions and 9 deletions
|
@ -735,16 +735,24 @@ NTSTATUS TCPClose
|
||||||
Socket = Connection->SocketContext;
|
Socket = Connection->SocketContext;
|
||||||
Connection->SocketContext = NULL;
|
Connection->SocketContext = NULL;
|
||||||
|
|
||||||
/* We need to close here otherwise oskit will never indicate
|
/* Don't try to close again if the other side closed us already */
|
||||||
* SEL_FIN and we will never fully close the connection
|
if (Connection->SignalState != SEL_FIN)
|
||||||
*/
|
|
||||||
Status = TCPTranslateError( OskitTCPClose( Socket ) );
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
Connection->SocketContext = Socket;
|
/* We need to close here otherwise oskit will never indicate
|
||||||
UnlockObject(Connection, OldIrql);
|
* SEL_FIN and we will never fully close the connection */
|
||||||
return Status;
|
Status = TCPTranslateError( OskitTCPClose( Socket ) );
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
Connection->SocketContext = Socket;
|
||||||
|
UnlockObject(Connection, OldIrql);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We are already closed by the other end so return success */
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Connection->AddressFile)
|
if (Connection->AddressFile)
|
||||||
|
|
Loading…
Reference in a new issue