Author: cgutman
Date: Thu Aug 19 02:41:54 2010
New Revision: 48561
URL:
http://svn.reactos.org/svn/reactos?rev=48561&view=rev
Log:
[IP]
- Fix a major bug in socket closure. Prior to this, a socket with pending IRPs that could
not be satisfied when the socket was closed would be destroyed without completing the
pending requests. Now, we check all of our IRP queues if we get a SEL_FIN signal and kill
all the requests that cannot be satisfied immediately.
- Maybe it's just me but Firefox 2 seems much more responsive after this fix (like
actually usable!)
Modified:
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
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] Thu Aug 19 02:41:54
2010
@@ -35,20 +35,20 @@
Connection, Connection->SocketContext));
/* Things that can happen when we try the initial connection */
- if( Connection->SignalState & SEL_CONNECT ) {
+ if( Connection->SignalState & (SEL_CONNECT | SEL_FIN) ) {
while (!IsListEmpty(&Connection->ConnectRequest)) {
Entry = RemoveHeadList( &Connection->ConnectRequest );
Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
- Bucket->Status = STATUS_SUCCESS;
+ Bucket->Status = (Connection->SignalState & SEL_CONNECT) ?
STATUS_SUCCESS : STATUS_CANCELLED;
Bucket->Information = 0;
InsertTailList(&Connection->CompletionQueue,
&Bucket->Entry);
}
}
- if( Connection->SignalState & SEL_ACCEPT ) {
+ if( Connection->SignalState & (SEL_ACCEPT | SEL_FIN) ) {
/* Handle readable on a listening socket --
* TODO: Implement filtering
*/
@@ -90,7 +90,7 @@
}
/* Things that happen after we're connected */
- if( Connection->SignalState & SEL_READ ) {
+ if( Connection->SignalState & (SEL_READ | SEL_FIN) ) {
TI_DbgPrint(DEBUG_TCP,("Readable: irp list %s\n",
IsListEmpty(&Connection->ReceiveRequest) ?
"empty" : "nonempty"));
@@ -145,7 +145,7 @@
}
}
}
- if( Connection->SignalState & SEL_WRITE ) {
+ if( Connection->SignalState & (SEL_WRITE | SEL_FIN) ) {
TI_DbgPrint(DEBUG_TCP,("Writeable: irp list %s\n",
IsListEmpty(&Connection->SendRequest) ?
"empty" : "nonempty"));