refactor: log UTP_ETIMEDOUT errors to 'trace' messages (#4237)

This commit is contained in:
A Cœur 2022-11-26 04:44:49 +08:00 committed by GitHub
parent 6b861806a6
commit 342484d14a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -387,7 +387,15 @@ static void utp_on_state_change(tr_peerIo* const io, int const state)
static void utp_on_error(tr_peerIo* const io, int const errcode)
{
tr_logAddDebugIo(io, fmt::format("utp_on_error -- errcode is {}", errcode));
if (errcode == UTP_ETIMEDOUT)
{
// high frequency error: we log as trace
tr_logAddTraceIo(io, fmt::format("utp_on_error -- UTP_ETIMEDOUT"));
}
else
{
tr_logAddDebugIo(io, fmt::format("utp_on_error -- {}", utp_error_code_names[errcode]));
}
if (io->gotError != nullptr)
{