diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-13 14:16:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-13 14:16:04 +0000 |
commit | 7555c1801d81d2f8ac2d4b953135ff980037f6b4 (patch) | |
tree | ced01b654c7775a21bbdccceab06023762acba75 /src/modules/m_spanningtree/main.cpp | |
parent | cb8e65e27064cb632050f1975aec27ed81cbefae (diff) |
Poach feature request: If a server does not respond after x seconds to a PING, send a warning to opers via +l snomask.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7010 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 09574f15f..4dc6eedc0 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -463,6 +463,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) sock->WriteLine(std::string(":")+ServerInstance->Config->ServerName+" PING "+serv->GetName()); serv->SetNextPingTime(curtime + 60); serv->LastPing = curtime; + serv->Warned = false; } else { @@ -476,6 +477,12 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) return; } } + else if ((Utils->PingWarnTime) && (!serv->Warned) && (curtime >= serv->NextPingTime() - (60 - Utils->PingWarnTime)) && (!serv->AnsweredLastPing())) + { + /* The server hasnt responded, send a warning to opers */ + ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not responded to PING for %d seconds, high latency.", serv->GetName().c_str(), Utils->PingWarnTime); + serv->Warned = true; + } } } } |