summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 0ecc595fc..35f63790b 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -203,7 +203,7 @@ class TreeServer
{
VersionString = "";
UserCount = OperCount = 0;
- this->SetNextPingTime(time(NULL) + 300);
+ this->SetNextPingTime(time(NULL) + 120);
this->SetPingFlag();
/* find the 'route' for this server (e.g. the one directly connected
@@ -1977,7 +1977,7 @@ class TreeSocket : public InspSocket
* When there is activity on the socket, reset the ping counter so
* that we're not wasting bandwidth pinging an active server.
*/
- route_back_again->SetNextPingTime(time(NULL) + 300);
+ route_back_again->SetNextPingTime(time(NULL) + 120);
route_back_again->SetPingFlag();
}
@@ -2594,6 +2594,7 @@ class ModuleSpanningTree : public Module
WriteOpers("*** SQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick);
sock->Squit(s,"Server quit by "+std::string(user->nick)+"!"+std::string(user->ident)+"@"+std::string(user->host));
sock->Close();
+ Srv->RemoveSocket(sock);
}
else
{
@@ -2637,22 +2638,24 @@ class ModuleSpanningTree : public Module
TreeSocket* sock = serv->GetSocket();
if (sock)
{
- if (curtime >= serv->NextPingTime())
- {
- if (serv->AnsweredLastPing())
- {
- sock->WriteLine(":"+Srv->GetServerName()+" PING "+serv->GetName());
- serv->SetNextPingTime(curtime + 300);
- }
- else
- {
- // they didnt answer, boot them
- WriteOpers("*** Server \002%s\002 pinged out",serv->GetName().c_str());
- sock->Squit(serv,"Ping timeout");
- sock->Close();
- return;
- }
- }
+ if (curtime >= serv->NextPingTime())
+ {
+ if (serv->AnsweredLastPing())
+ {
+ sock->WriteLine(":"+Srv->GetServerName()+" PING "+serv->GetName());
+ serv->SetNextPingTime(curtime + 120);
+ }
+ else
+ {
+ // they didnt answer, boot them
+ WriteOpers("*** Server \002%s\002 pinged out",serv->GetName().c_str());
+ sock->Squit(serv,"Ping timeout");
+ sock->Close();
+ Srv->RemoveSocket(sock);
+ return;
+ }
+ }
+
}
}
}