mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
- 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:
parent
15d003fb13
commit
56d37e6da3
2 changed files with 13 additions and 7 deletions
|
@ -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) );
|
||||
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 );
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue