mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
- Fix some confusion between SignalState and State which resulted in queued IRPs being lost on socket closure
- Call HandleSignalledConnection directly because the connection may not be in the signalled connections list - Remove State from CONNECTION_ENDPOINT to prevent this from happening again svn path=/trunk/; revision=43922
This commit is contained in:
@@ -299,8 +299,6 @@ typedef struct _CONNECTION_ENDPOINT {
|
||||
PADDRESS_FILE AddressFile; /* Associated address file object (NULL if none) */
|
||||
PVOID SocketContext; /* Context for lower layer */
|
||||
|
||||
UINT State; /* Socket state W.R.T. oskit */
|
||||
|
||||
/* Requests */
|
||||
LIST_ENTRY ConnectRequest; /* Queued connect rqueusts */
|
||||
LIST_ENTRY ListenRequest; /* Queued listen requests */
|
||||
|
||||
@@ -26,7 +26,7 @@ int TCPSocketState(void *ClientData,
|
||||
|
||||
TI_DbgPrint(DEBUG_TCP,("Called: NewState %x (Conn %x) (Change %x)\n",
|
||||
NewState, Connection,
|
||||
Connection ? Connection->State ^ NewState :
|
||||
Connection ? Connection->SignalState ^ NewState :
|
||||
NewState));
|
||||
|
||||
if( !Connection ) {
|
||||
|
||||
@@ -601,11 +601,6 @@ NTSTATUS TCPConnect
|
||||
return STATUS_NETWORK_UNREACHABLE;
|
||||
}
|
||||
|
||||
if (Connection->State & SEL_FIN)
|
||||
{
|
||||
return STATUS_REMOTE_DISCONNECT;
|
||||
}
|
||||
|
||||
/* Freed in TCPSocketState */
|
||||
TI_DbgPrint(DEBUG_TCP,
|
||||
("Connecting to address %x:%x\n",
|
||||
@@ -683,8 +678,8 @@ NTSTATUS TCPClose
|
||||
ASSERT_LOCKED(&TCPLock);
|
||||
|
||||
/* Make our code remove all pending IRPs */
|
||||
Connection->State |= SEL_FIN;
|
||||
DrainSignals();
|
||||
Connection->SignalState |= SEL_FIN;
|
||||
HandleSignalledConnection(Connection);
|
||||
|
||||
Status = TCPTranslateError( OskitTCPClose( Connection->SocketContext ) );
|
||||
if (Status == STATUS_SUCCESS)
|
||||
@@ -715,13 +710,6 @@ NTSTATUS TCPReceiveData
|
||||
|
||||
ASSERT_KM_POINTER(Connection->SocketContext);
|
||||
|
||||
/* Closing */
|
||||
if (Connection->State & SEL_FIN)
|
||||
{
|
||||
*BytesReceived = 0;
|
||||
return STATUS_REMOTE_DISCONNECT;
|
||||
}
|
||||
|
||||
NdisQueryBuffer( Buffer, &DataBuffer, &DataLen );
|
||||
|
||||
TI_DbgPrint(DEBUG_TCP,("TCP>|< Got an MDL %x (%x:%d)\n", Buffer, DataBuffer, DataLen));
|
||||
@@ -786,12 +774,6 @@ NTSTATUS TCPSendData
|
||||
TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext = %x\n",
|
||||
Connection->SocketContext));
|
||||
|
||||
/* Closing */
|
||||
if (Connection->State & SEL_FIN)
|
||||
{
|
||||
*BytesSent = 0;
|
||||
return STATUS_REMOTE_DISCONNECT;
|
||||
}
|
||||
|
||||
Status = TCPTranslateError
|
||||
( OskitTCPSend( Connection->SocketContext,
|
||||
|
||||
Reference in New Issue
Block a user