mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed more socket close problems. You could get through TCPClose, unlock
the socket, have somebody else service and even, and unlink the connection object at the same time. Now we hold the TCP lock while removing a connection. svn path=/trunk/; revision=13732
This commit is contained in:
parent
31907da958
commit
b0588e3ebf
2 changed files with 4 additions and 5 deletions
|
@ -10,8 +10,6 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
extern VOID DrainSignals();
|
||||
|
||||
int TCPSocketState(void *ClientData,
|
||||
void *WhichSocket,
|
||||
void *WhichConnection,
|
||||
|
@ -32,10 +30,9 @@ int TCPSocketState(void *ClientData,
|
|||
if( !Connection ) {
|
||||
TI_DbgPrint(DEBUG_TCP,("Socket closing.\n"));
|
||||
Connection = FileFindConnectionByContext( WhichSocket );
|
||||
if( !Connection ) {
|
||||
TcpipRecursiveMutexLeave( &TCPLock );
|
||||
if( !Connection )
|
||||
return 0;
|
||||
} else
|
||||
else
|
||||
TI_DbgPrint(DEBUG_TCP,("Found socket %x\n", Connection));
|
||||
}
|
||||
|
||||
|
|
|
@ -471,8 +471,10 @@ NTSTATUS FileCloseConnection(
|
|||
|
||||
Connection = Request->Handle.ConnectionContext;
|
||||
|
||||
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
|
||||
TCPClose(Connection);
|
||||
DeleteConnectionEndpoint(Connection);
|
||||
TcpipRecursiveMutexLeave( &TCPLock );
|
||||
|
||||
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue