X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Ftcp.c;h=68e72d76b2b5d4d6697c7130aa7e347cda1ef8f1;hb=fcd0edcb2a6fc81db61046cfa685ce32037b673f;hp=fe7c299dd4bd91afb5f296b20a1400dc32601eec;hpb=fbdee4576c1abe0e817ed974c882bfec63eaa842;p=tpg%2Facess2.git diff --git a/Modules/IPStack/tcp.c b/Modules/IPStack/tcp.c index fe7c299d..68e72d76 100644 --- a/Modules/IPStack/tcp.c +++ b/Modules/IPStack/tcp.c @@ -64,6 +64,7 @@ Uint32 gaTCP_PortBitmap[0x800]; */ void TCP_Initialise(void) { + giTCP_NextOutPort += rand()%32; IPStack_AddFile(&gTCP_ServerFile); IPStack_AddFile(&gTCP_ClientFile); IPv4_RegisterCallback(IP4PROT_TCP, TCP_GetPacket); @@ -412,6 +413,7 @@ void TCP_INT_HandleConnectionPacket(tTCPConnection *Connection, tTCPHeader *Head // TODO: This should be moved out of the watcher thread, // so that a single lost packet on one connection doesn't cause // all connections on the interface to lag. + // - Meh, no real issue, as the cache shouldn't be that large TCP_INT_UpdateRecievedFromFuture(Connection); // ACK Packet @@ -601,9 +603,7 @@ void TCP_INT_AppendRecieved(tTCPConnection *Connection, tTCPStoredPacket *Pkt) RingBuffer_Write( Connection->RecievedBuffer, Pkt->Data, Pkt->Length ); - #if USE_SELECT VFS_MarkAvaliable(&Connection->Node, 1); - #endif Mutex_Release( &Connection->lRecievedPackets ); } @@ -1065,7 +1065,7 @@ void TCP_INT_SendDataPacket(tTCPConnection *Connection, size_t Length, void *Dat packet->SourcePort = htons(Connection->LocalPort); packet->DestPort = htons(Connection->RemotePort); packet->DataOffset = (sizeof(tTCPHeader)/4)*16; - packet->WindowSize = TCP_WINDOW_SIZE; + packet->WindowSize = htons(TCP_WINDOW_SIZE); packet->AcknowlegementNumber = htonl(Connection->NextSequenceRcv); packet->SequenceNumber = htonl(Connection->NextSequenceSend);