From 63532b2c9bac673bf7d32e77c05a80831e055d81 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 20 Oct 2012 14:53:54 +0000 Subject: [PATCH] the sack header needs to be removed from a nagle packet or a re-sent packet if there are no longer any unordered incoming packets --- src/utp_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index f54a88139..8216b748b 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -1710,7 +1710,9 @@ bool utp_socket_impl::send_pkt(int flags) if (h->extension == 1) { sack = ptr[1]; - if (m_inbuf.size() == 0 && h->ack_nr != m_ack_nr) + // if we no longer have any out-of-order packets waiting + // to be delivered, there's no selective ack to be sent. + if (m_inbuf.size() == 0) { // we need to remove the sack header remove_sack_header(p);