#define TCP_RECIEVE_BUFFER_SIZE 0x4000
// === PROTOTYPES ===
-void TCP_Initialise();
+void TCP_Initialise(void);
void TCP_StartConnection(tTCPConnection *Conn);
void TCP_SendPacket(tTCPConnection *Conn, size_t Length, tTCPHeader *Data);
void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer);
*
* Registers the client and server files and the GetPacket callback
*/
-void TCP_Initialise()
+void TCP_Initialise(void)
{
IPStack_AddFile(&gTCP_ServerFile);
IPStack_AddFile(&gTCP_ClientFile);
// - Handle State changes
//
if( Header->Flags & TCP_FLAG_FIN ) {
- Log_Log("TCP", "Conn %p closed, recieved FIN, acknowledging", Connection);
+ Log_Log("TCP", "Conn %p closed, recieved FIN", Connection);
VFS_MarkError(&Connection->Node, 1);
Connection->State = TCP_ST_CLOSE_WAIT;
+// Header->Flags &= ~TCP_FLAG_FIN;
// CLOSE WAIT requires the client to close (or does it?)
#if 0
ENTER("pNode XOffset XLength pBuffer", Node, Offset, Length, Buffer);
+// #if DEBUG
+// Debug_HexDump("TCP_Client_Write: Buffer = ",
+// Buffer, Length);
+// #endif
+
// Check if connection is open
while( conn->State == TCP_ST_SYN_RCVD || conn->State == TCP_ST_SYN_SENT )
Threads_Yield();
TCP_INT_SendDataPacket(conn, len, Buffer);
Buffer += len;
- rem += len;
+ rem -= len;
} while( rem > 0 );
LEAVE('i', Length);