1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 07:14:58 +00:00

Kernel/TCPSocket: Read window size from peer

During receive_tcp_packet(), we now set m_send_window_size for the
socket if it is different from the default.

This removes one FIXME from TCPSocket.h.
This commit is contained in:
Optimoos 2023-06-18 22:05:00 -04:00 committed by Andreas Kling
parent 701b170dc0
commit e72894f23d
2 changed files with 5 additions and 1 deletions

View file

@ -321,6 +321,9 @@ void TCPSocket::receive_tcp_packet(TCPPacket const& packet, u16 size)
if (old_adapter)
old_adapter->release_packet_buffer(*packet.buffer);
TCPPacket& tcp_packet = *(TCPPacket*)(packet.buffer->buffer->data() + packet.ipv4_payload_offset);
if (m_send_window_size != tcp_packet.window_size()) {
m_send_window_size = tcp_packet.window_size();
}
auto payload_size = packet.buffer->buffer->data() + packet.buffer->buffer->size() - (u8*)tcp_packet.payload();
unacked_packets.size -= payload_size;
evaluate_block_conditions();