diff options
author | ANAND <ClobberXD@gmail.com> | 2019-02-16 05:09:22 +0530 |
---|---|---|
committer | Paramat <paramat@users.noreply.github.com> | 2019-02-15 23:39:22 +0000 |
commit | 7a0e52acd65e7097977c924f26b387ec3da9baac (patch) | |
tree | 4d61197820480c17b4d032c07b64e23d93334c88 /src/network/connectionthreads.cpp | |
parent | 2153163cbd0a57783e646523c62e83bfe1be2277 (diff) | |
download | minetest-7a0e52acd65e7097977c924f26b387ec3da9baac.tar.xz |
Revert RTT fixes (#8187)
The reverted commit 968ce9af598024ec71e9ffb2d15c3997a13ad754
is suspected (through the use of bisection) of causing network slowdowns.
Revert for now as we are close to release.
Diffstat (limited to 'src/network/connectionthreads.cpp')
-rw-r--r-- | src/network/connectionthreads.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/network/connectionthreads.cpp b/src/network/connectionthreads.cpp index 5e4397d90..63a9064e7 100644 --- a/src/network/connectionthreads.cpp +++ b/src/network/connectionthreads.cpp @@ -1155,17 +1155,19 @@ SharedBuffer<u8> ConnectionReceiveThread::handlePacketType_Control(Channel *chan // a overflow is quite unlikely but as it'd result in major // rtt miscalculation we handle it here - float rtt = 0.0f; if (current_time > p.absolute_send_time) { - rtt = (current_time - p.absolute_send_time) / 1000.0f; + float rtt = (current_time - p.absolute_send_time) / 1000.0; + + // Let peer calculate stuff according to it + // (avg_rtt and resend_timeout) + dynamic_cast<UDPPeer *>(peer)->reportRTT(rtt); } else if (p.totaltime > 0) { - rtt = p.totaltime; - } + float rtt = p.totaltime; - // Let peer calculate stuff according to it - // (avg_rtt and resend_timeout) - if (rtt != 0.0f) + // Let peer calculate stuff according to it + // (avg_rtt and resend_timeout) dynamic_cast<UDPPeer *>(peer)->reportRTT(rtt); + } } // put bytes for max bandwidth calculation channel->UpdateBytesSent(p.data.getSize(), 1); |