From bf2f0a9c5540c0dbbea45a0a70743f9942ad4d0d Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Wed, 28 Feb 2018 11:50:41 +0100 Subject: [PATCH] Fix advertised window being counted twice in congestion check --- src/utp_stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index e305296c5..423313574 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -1830,7 +1830,7 @@ bool utp_socket_impl::send_pkt(int const flags) // congestion window and the advertised receive window from // the other end. if (m_bytes_in_flight + payload_size > (std::min)(int(m_cwnd >> 16) - , int(m_adv_wnd - m_bytes_in_flight))) + , int(m_adv_wnd))) { // this means there's not enough room in the send window for // another packet. We have to hold off sending this data.