usbmuxd icon indicating copy to clipboard operation
usbmuxd copied to clipboard

ACK packets sometimes sent twice

Open MCE-KobyBo opened this issue 10 years ago • 1 comments

While testing, I've noticed that sometimes ACK packets were sent twice in a row. After going through the code, I think I've found the reason: In device_tcp_input, when data is received from the device on a TCP connection, an ACK is sent (a call to send_tcp_ack was added in a recent commit). But, since the connection's tx_ack is only increased in device_client_process (after the data is actually sent to the client), the ACK doesn't ACK the data received. So in my case, another ACK was sent in the next iteration because of a timeout (after the data was sent to the client). I think it would be better to send the ACK after increasing tx_ack, either in device_tcp_input or in device_client_process. What do you think?

MCE-KobyBo avatar May 04 '14 06:05 MCE-KobyBo

Thanks, confirming this is a bug. I think it would be good to not sent duplicate or obsolete ACKs at all and fix up the I/O to properly ACK packets.

FunkyM avatar Oct 30 '14 21:10 FunkyM