X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FIPStack%2Ftcp.c;h=a8a059ac61dd3fc5b715743c369a305e4ee07b88;hb=d7dcea0e5a8df0f479e99f168a10b9a9535c7ad6;hp=5c65a52e2b8a52df4d35c1c4c05513809747bdb4;hpb=4e407e69bd660e9a32644281733192193ee6e8c8;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/IPStack/tcp.c b/KernelLand/Modules/IPStack/tcp.c index 5c65a52e..a8a059ac 100644 --- a/KernelLand/Modules/IPStack/tcp.c +++ b/KernelLand/Modules/IPStack/tcp.c @@ -2,7 +2,7 @@ * Acess2 IP Stack * - TCP Handling */ -#define DEBUG 1 +#define DEBUG 0 #include "ipstack.h" #include "ipv4.h" #include "ipv6.h" @@ -20,7 +20,7 @@ #define TCP_DACK_THRESHOLD 4096 #define TCP_DACK_TIMEOUT 100 -#define TCP_DEBUG 1 // Set to non-0 to enable TCP packet logging +#define TCP_DEBUG 0 // Set to non-0 to enable TCP packet logging // === PROTOTYPES === void TCP_Initialise(void); @@ -67,6 +67,7 @@ tVFS_NodeType gTCP_ServerNodeType = { }; tVFS_NodeType gTCP_ClientNodeType = { .TypeName = "TCP Client/Connection", + .Flags = VFS_NODETYPEFLAG_STREAM, .Read = TCP_Client_Read, .Write = TCP_Client_Write, .IOCtl = TCP_Client_IOCtl, @@ -345,6 +346,7 @@ int TCP_INT_HandleServerPacket(tInterface *Interface, tTCPListener *Server, cons conn->LastACKSequence = ntohl( Header->SequenceNumber ); conn->Node.ImplInt = Server->NextID ++; + conn->Node.Size = -1; // Hmm... Theoretically, this lock will never have to wait, // as the interface is locked to the watching thread, and this @@ -899,6 +901,7 @@ tTCPConnection *TCP_int_CreateConnection(tInterface *Interface, enum eTCPConnect conn->LocalPort = -1; conn->RemotePort = -1; + conn->Node.Size = -1; conn->Node.ReferenceCount = 1; conn->Node.ImplPtr = conn; conn->Node.NumACLs = 1; @@ -1264,6 +1267,8 @@ void TCP_INT_SendDataPacket(tTCPConnection *Connection, size_t Length, const voi TCP_SendPacket( Connection, packet, Length, Data ); + // TODO: Start a retransmit time (if data is not ACKed in x seconds, send again) + Connection->NextSequenceSend += Length; }