- 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

svn path=/branches/aicom-network-fixes/; revision=36309
This commit is contained in:
Cameron Gutman 2008-09-19 02:12:55 +00:00
parent 15d003fb13
commit 56d37e6da3
2 changed files with 13 additions and 7 deletions

View file

@ -117,6 +117,7 @@ VOID TCPAbortListenForSocket( PCONNECTION_ENDPOINT Listener,
if( Bucket->AssociatedEndpoint == Connection ) {
RemoveEntryList( ListEntry->Blink );
ExFreePool( Bucket );
break;
}
}
@ -141,10 +142,14 @@ NTSTATUS TCPAccept
if( Status == STATUS_PENDING ) {
Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
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 );

View file

@ -104,8 +104,7 @@ int TCPPacketSend(void *ClientData, OSK_PCHAR data, OSK_UINT len ) {
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 @@ int TCPSleep( void *ClientData, void *token, int priority, char *msg,
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
PoolFreeBuffer( SleepingThread );
}
} else
return OSK_ENOBUFS;
TI_DbgPrint(DEBUG_TCP,("Waiting finished: %x\n", token));
return 0;
}