mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 19:42:14 +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:
parent
e8fee92357
commit
1b2ef8582c
47 changed files with 97 additions and 91 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue