#include "precomp.h"
-extern VOID DrainSignals();
-
int TCPSocketState(void *ClientData,
- void *WhichSocket,
+ void *WhichSocket,
void *WhichConnection,
OSK_UINT NewState ) {
PCONNECTION_ENDPOINT Connection = WhichConnection;
- TI_DbgPrint(DEBUG_TCP,("Called: NewState %x (Conn %x) (Change %x)\n",
+ TI_DbgPrint(MID_TRACE,("Flags: %c%c%c%c\n",
+ NewState & SEL_CONNECT ? 'C' : 'c',
+ NewState & SEL_READ ? 'R' : 'r',
+ NewState & SEL_FIN ? 'F' : 'f',
+ NewState & SEL_ACCEPT ? 'A' : 'a'));
+
+ TI_DbgPrint(DEBUG_TCP,("Called: NewState %x (Conn %x) (Change %x)\n",
NewState, Connection,
- Connection ? Connection->State ^ NewState :
+ Connection ? Connection->State ^ NewState :
NewState));
if( !Connection ) {
TI_DbgPrint(DEBUG_TCP,("Socket closing.\n"));
Connection = FileFindConnectionByContext( WhichSocket );
- if( !Connection ) {
- TcpipRecursiveMutexLeave( &TCPLock );
+ if( !Connection )
return 0;
- } else
+ else
TI_DbgPrint(DEBUG_TCP,("Found socket %x\n", Connection));
}
+ TI_DbgPrint(MID_TRACE,("Connection signalled: %d\n",
+ Connection->Signalled));
+
+ Connection->SignalState |= NewState;
if( !Connection->Signalled ) {
Connection->Signalled = TRUE;
- Connection->SignalState = NewState;
InsertTailList( &SignalledConnections, &Connection->SignalList );
}
return OSK_EADDRNOTAVAIL;
}
- NdisStatus = AllocatePacketWithBuffer( &Packet.NdisPacket, NULL,
+ NdisStatus = AllocatePacketWithBuffer( &Packet.NdisPacket, NULL,
MaxLLHeaderSize + len );
-
+
if (NdisStatus != NDIS_STATUS_SUCCESS) {
TI_DbgPrint(DEBUG_TCP, ("Error from NDIS: %08x\n", NdisStatus));
- return STATUS_NO_MEMORY;
+ return OSK_ENOBUFS;
}
- GetDataPtr( Packet.NdisPacket, MaxLLHeaderSize,
+ GetDataPtr( Packet.NdisPacket, MaxLLHeaderSize,
(PCHAR *)&Packet.Header, &Packet.ContigSize );
RtlCopyMemory( Packet.Header, data, len );
Packet.DstAddr = RemoteAddress;
IPSendDatagram( &Packet, NCE, TCPPacketSendComplete, NULL );
-
+
if( !NT_SUCCESS(NdisStatus) ) return OSK_EINVAL;
else return 0;
}
int TCPSleep( void *ClientData, void *token, int priority, char *msg,
int tmio ) {
PSLEEPING_THREAD SleepingThread;
-
+
TI_DbgPrint(DEBUG_TCP,
("Called TSLEEP: tok = %x, pri = %d, wmesg = %s, tmio = %x\n",
token, priority, msg, tmio));