mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +00:00
parent
2d1cff1a24
commit
97229c1813
1 changed files with 10 additions and 1 deletions
11
third-party/libutp/utp.cpp
vendored
11
third-party/libutp/utp.cpp
vendored
|
@ -1893,10 +1893,19 @@ size_t UTP_ProcessIncoming(UTPSocket *conn, const byte *packet, size_t len, bool
|
|||
for (int i = 0; i < acks; ++i) {
|
||||
int seq = conn->seq_nr - conn->cur_window_packets + i;
|
||||
OutgoingPacket *pkt = (OutgoingPacket*)conn->outbuf.get(seq);
|
||||
int64 rtt;
|
||||
if (pkt == 0 || pkt->transmissions == 0) continue;
|
||||
assert((int)(pkt->payload) >= 0);
|
||||
acked_bytes += pkt->payload;
|
||||
min_rtt = min<int64>(min_rtt, UTP_GetMicroseconds() - pkt->time_sent);
|
||||
rtt = UTP_GetMicroseconds() - pkt->time_sent;
|
||||
if(rtt < 0) {
|
||||
LOG_UTP("UTP_GetMicroseconds decreased (%ld > %ld). "
|
||||
"This should not happen.",
|
||||
(long)pkt->time_sent,
|
||||
(long)(pkt->time_sent + rtt));
|
||||
rtt = 0;
|
||||
}
|
||||
min_rtt = min<int64>(min_rtt, rtt);
|
||||
}
|
||||
|
||||
// count bytes acked by EACK
|
||||
|
|
Loading…
Reference in a new issue