Author: cgutman
Date: Mon Nov 2 21:26:29 2009
New Revision: 43922
URL:
http://svn.reactos.org/svn/reactos?rev=43922&view=rev
Log:
- 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
Modified:
trunk/reactos/drivers/network/tcpip/include/titypes.h
trunk/reactos/lib/drivers/ip/transport/tcp/event.c
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
Modified: trunk/reactos/drivers/network/tcpip/include/titypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/titypes.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/titypes.h [iso-8859-1] Mon Nov 2 21:26:29
2009
@@ -299,8 +299,6 @@
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 */
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Mon Nov 2 21:26:29
2009
@@ -26,7 +26,7 @@
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 ) {
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Mon Nov 2 21:26:29
2009
@@ -601,11 +601,6 @@
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 @@
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 @@
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 @@
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,