1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 14:13:23 +00:00

Revert "Protect against broken implementations of monotonic time."

There are other instances of GetMicroseconds in the code, so a proper
paranoiac would want to work around that at a lower level.
This commit is contained in:
Juliusz Chroboczek 2011-03-12 22:45:14 +00:00
parent 03d35fa06b
commit 63917c907b

View file

@ -1893,19 +1893,10 @@ 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;
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);
min_rtt = min<int64>(min_rtt, UTP_GetMicroseconds() - pkt->time_sent);
}
// count bytes acked by EACK