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:
Art Yerkes 2005-02-24 08:51:18 +00:00
parent 31907da958
commit b0588e3ebf
2 changed files with 4 additions and 5 deletions

View file

@ -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));
}

View file

@ -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"));