mirror of
https://github.com/transmission/transmission
synced 2024-12-23 16:24:02 +00:00
(trunk libT) #4153 "Protect against non-monotonic time in libutp" -- move UTP_GetMilliseconds() and UTP_GetMicroseconds() outside of the if-not-windows ifdef section. Based on feedback from rb07 in ticket comment 5
This commit is contained in:
parent
e8c22599cb
commit
4cf4000620
1 changed files with 4 additions and 4 deletions
8
third-party/libutp/utp_utils.cpp
vendored
8
third-party/libutp/utp_utils.cpp
vendored
|
@ -112,7 +112,7 @@ static uint64 GetMicroseconds()
|
|||
return ((tick - start_tick) * sTimebaseInfo.numer) / (sTimebaseInfo.denom * 1000);
|
||||
}
|
||||
|
||||
#else
|
||||
#else //!__APPLE__
|
||||
|
||||
/* Unfortunately, #ifdef CLOCK_MONOTONIC is not enough to make sure that
|
||||
POSIX clocks work -- we could be running a recent libc with an ancient
|
||||
|
@ -146,7 +146,9 @@ static uint64_t GetMicroseconds()
|
|||
return uint64(tv.tv_sec) * 1000000 + tv.tv_usec;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif //!__APPLE__
|
||||
|
||||
#endif //!WIN32
|
||||
|
||||
uint64 UTP_GetMicroseconds()
|
||||
{
|
||||
|
@ -167,8 +169,6 @@ uint32 UTP_GetMilliseconds()
|
|||
return UTP_GetMicroseconds() / 1000;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define ETHERNET_MTU 1500
|
||||
#define IPV4_HEADER_SIZE 20
|
||||
|
|
Loading…
Reference in a new issue