mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +00:00
Kernel: Make File's can_read/can_write take a const FileDescription&
Asking a File if we could possibly read or write it will never mutate the asking FileDescription&, so it should be const.
This commit is contained in:
@@ -574,9 +574,12 @@ void handle_tcp(const IPv4Packet& ipv4_packet)
|
||||
socket->sequence_number());
|
||||
#endif
|
||||
|
||||
socket->send_tcp_packet(TCPFlags::ACK);
|
||||
bool should_ack = true;
|
||||
if (payload_size != 0) {
|
||||
should_ack = socket->did_receive(ipv4_packet.source(), tcp_packet.source_port(), KBuffer::copy(&ipv4_packet, sizeof(IPv4Packet) + ipv4_packet.payload_size()));
|
||||
}
|
||||
|
||||
if (payload_size != 0)
|
||||
socket->did_receive(ipv4_packet.source(), tcp_packet.source_port(), KBuffer::copy(&ipv4_packet, sizeof(IPv4Packet) + ipv4_packet.payload_size()));
|
||||
if (should_ack)
|
||||
socket->send_tcp_packet(TCPFlags::ACK);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user