tcp: Ack data and FIN in a single packet

This commit is contained in:
Asias He
2014-10-24 16:25:35 +08:00
parent cbc5e9392f
commit fb0123ec61

View File

@@ -520,7 +520,11 @@ void tcp<InetTraits>::tcb::input(tcp_hdr* th, packet p) {
_rcv._user_waiting = false;
_rcv._data_received.set_value();
}
// If this <FIN> packet contains data as well, we can ACK both data
// and <FIN> in a single packet, so canncel the previous ACK.
clear_delayed_ack();
output();
// FIXME: Implement TIME-WAIT state
if (both_closed()) {
clear_delayed_ack();