don't assert session time doesn't step too far, just clamp it

This commit is contained in:
arvidn 2020-03-15 21:18:28 +01:00 committed by Arvid Norberg
parent ce9be0c83f
commit 055055a0d3
1 changed files with 2 additions and 1 deletions

View File

@ -1095,7 +1095,8 @@ namespace aux {
std::int64_t const ret = total_seconds(aux::time_now()
- m_created) + 1;
TORRENT_ASSERT(ret >= 0);
TORRENT_ASSERT(ret <= (std::numeric_limits<std::uint16_t>::max)());
if (ret > (std::numeric_limits<std::uint16_t>::max)())
return (std::numeric_limits<std::uint16_t>::max)();
return static_cast<std::uint16_t>(ret);
}
time_point session_start_time() const override