Kernel: Cleanup and optimize TCP
We now only send enough data to fill other ends window, not past that. Previous logic had a but that allowed sending too much data leading to retransmissions. When the target sends zero window and later updates window size, immediately retransmit non-acknowledged bytes. Don't validate packets through listeing socket twice. The actual socket will already verify the checksum so the listening socket does not have to.
This commit is contained in:
@@ -117,6 +117,7 @@ namespace Kernel
|
||||
uint64_t last_send_ms { 0 }; // last send time, used for retransmission timeout
|
||||
|
||||
bool has_ghost_byte { false };
|
||||
bool had_zero_window { false };
|
||||
|
||||
uint32_t data_tail { 0 };
|
||||
uint32_t data_size { 0 }; // number of bytes in this buffer
|
||||
@@ -179,6 +180,8 @@ namespace Kernel
|
||||
bool m_keep_alive { false };
|
||||
bool m_no_delay { false };
|
||||
|
||||
bool m_should_send_ack { false };
|
||||
|
||||
uint64_t m_time_wait_start_ms { 0 };
|
||||
|
||||
ThreadBlocker m_thread_blocker;
|
||||
|
||||
Reference in New Issue
Block a user