mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
uip_mss() is the limit on the next segment, not a record of the last one: uIP recomputes it from the window the peer advertises in every incoming segment, before the application is called. The ACK path subtracted it from slen and added it to o_idx, and the retransmit path handed it to uip_send(), so whenever the window moved between a segment going out and its ACK coming back, the file being served lost or repeated the difference. A window shrinking from 1460 to 600 between the two repeats 860 bytes under fresh sequence numbers, which a browser writes into the file; a window opening the same way skips 860. Remember the length in tx_send() and use it in both places. The retransmit path then repeats exactly the segment uIP still counts as outstanding, which is what uip_connr->len makes it put on the wire.