Skip to content

Commit

Permalink
Raise our IRC connection timeouts
Browse files Browse the repository at this point in the history
ZNC will now send a PING if the connection was idle for 270 to 300 seconds.
After 540 seconds (that is, about 270 to 240 seconds later) the timeout is
triggered and ZNC reconnects.

These values are "inspired" by the values eggdrop uses.

The old timeouts were 180 to 210 secs for the PING and 240 secs for the timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed Apr 2, 2011
1 parent f0bf713 commit d2f3b8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,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(240, TMO_READ);
SetTimeout(540, TMO_READ);

SetSockName("USR::" + m_pUser->GetUserName());

Expand Down
2 changes: 1 addition & 1 deletion IRCSock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void CIRCSock::ReadLine(const CString& sData) {
}

m_pUser->SetIRCServer(sServer);
SetTimeout(240, TMO_READ); // Now that we are connected, let nature take its course
SetTimeout(540, TMO_READ); // Now that we are connected, let nature take its course
PutIRC("WHO " + sNick);

m_bAuthed = true;
Expand Down
4 changes: 2 additions & 2 deletions User.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class CUserTimer : public CCron {
vector<CClient*>& vClients = m_pUser->GetClients();
CIRCSock* pIRCSock = m_pUser->GetIRCSock();

if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= 180) {
if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= 270) {
pIRCSock->PutIRC("PING :ZNC");
}

for (size_t a = 0; a < vClients.size(); a++) {
CClient* pClient = vClients[a];

if (pClient->GetTimeSinceLastDataTransaction() >= 180) {
if (pClient->GetTimeSinceLastDataTransaction() >= 270) {
pClient->PutClient("PING :ZNC");
}
}
Expand Down

0 comments on commit d2f3b8c

Please sign in to comment.