Author: cgutman
Date: Thu Sep 18 21:12:55 2008
New Revision: 36309
URL:
http://svn.reactos.org/svn/reactos?rev=36309&view=rev
Log:
- Exit the loop when we find the matching Bucket
- Make sure we allocated Bucket
- Remove a useless if
- Return OSK_ENOBUFS if we can't allocate SleepingThread
Modified:
branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c
branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/event.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] Thu
Sep 18 21:12:55 2008
@@ -117,6 +117,7 @@
if( Bucket->AssociatedEndpoint == Connection ) {
RemoveEntryList( ListEntry->Blink );
ExFreePool( Bucket );
+ break;
}
}
@@ -141,10 +142,14 @@
if( Status == STATUS_PENDING ) {
Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
- Bucket->AssociatedEndpoint = Connection;
- Bucket->Request.RequestNotifyObject = Complete;
- Bucket->Request.RequestContext = Context;
- InsertHeadList( &Listener->ListenRequest, &Bucket->Entry );
+
+ if( Bucket ) {
+ Bucket->AssociatedEndpoint = Connection;
+ Bucket->Request.RequestNotifyObject = Complete;
+ Bucket->Request.RequestContext = Context;
+ InsertHeadList( &Listener->ListenRequest, &Bucket->Entry );
+ } else
+ Status = STATUS_NO_MEMORY;
}
TcpipRecursiveMutexLeave( &TCPLock );
Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/event.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/event.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Thu Sep
18 21:12:55 2008
@@ -104,8 +104,7 @@
IPSendDatagram( &Packet, NCE, TCPPacketSendComplete, NULL );
- if( !NT_SUCCESS(NdisStatus) ) return OSK_EINVAL;
- else return 0;
+ return 0;
}
int TCPSleep( void *ClientData, void *token, int priority, char *msg,
@@ -144,7 +143,9 @@
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
PoolFreeBuffer( SleepingThread );
- }
+ } else
+ return OSK_ENOBUFS;
+
TI_DbgPrint(DEBUG_TCP,("Waiting finished: %x\n", token));
return 0;
}