mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Less magic numbers for timeout settings
Currently the connection timeout handling of znc uses three magic numbers, each of which is at least repeated in two unrelated places. This commits defines the numbers in CIRCNetwork and makes the other places just use this number. This also renames PING_TIMEOUT to PING_FREQUENCY because I feel that describes this constant better. I am not really happy about the name NO_TRAFFIC_TIMEOUT that is used for the real timeout, but I couldn't think of a better name. PING_TIMEOUT isn't good because that sounds like the time between sending a PING and the resulting timeout. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
@@ -671,7 +671,7 @@ void CClient::AcceptLogin(CUser& User) {
|
||||
|
||||
// Set our proper timeout and set back our proper timeout mode
|
||||
// (constructor set a different timeout and mode)
|
||||
SetTimeout(540, TMO_READ);
|
||||
SetTimeout(CIRCNetwork::NO_TRAFFIC_TIMEOUT, TMO_READ);
|
||||
|
||||
SetSockName("USR::" + m_pUser->GetUserName());
|
||||
SetEncoding(m_pUser->GetClientEncoding());
|
||||
|
||||
Reference in New Issue
Block a user