Skip to content

Commit

Permalink
Use different log level for failed but non critical ::recv() call
Browse files Browse the repository at this point in the history
  • Loading branch information
0blu committed Dec 10, 2024
1 parent ea1c5d3 commit 43af32f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shared/IO/Networking/AsyncSocket_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ void IO::Networking::AsyncSocket::PerformNonBlockingRead()
}
if (newWrittenBytes < 0)
{
sLog.Out(LOG_NETWORK, LOG_LVL_ERROR, "[%s] ::recv on client failed: %s", GetRemoteIpString().c_str(), SystemErrorToString(errno).c_str());
// If ::recv() failed because the socket is "not ready" we simply use a higher log level
sLog.Out(LOG_NETWORK, errno == EWOULDBLOCK ? LOG_LVL_BASIC : LOG_LVL_ERROR, "[%s] ::recv on client failed: %s", GetRemoteIpString().c_str(), SystemErrorToString(errno).c_str());
m_atomicState.fetch_and(~SocketStateFlags::READ_PENDING_LOAD);
return;
}
Expand Down

0 comments on commit 43af32f

Please sign in to comment.