summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/inspircd.conf.example5
-rw-r--r--src/modules/m_spanningtree/main.cpp4
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp2
-rw-r--r--src/modules/m_spanningtree/utils.cpp6
-rw-r--r--src/modules/m_spanningtree/utils.h4
6 files changed, 18 insertions, 5 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index 248394c42..c35f90ea4 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -876,6 +876,10 @@
# such as BOPM which rely on them to scan users when #
# a split heals in certain configurations. #
# #
+# serverpingfreq- This value, when set, allows you to change the #
+# frequency of server to server PING messages. This #
+# can help if you are having certain network issues. #
+# #
# pingwarning - This should be set to a number between 1 and 59 if #
# defined, and if it is defined will cause the server#
# to send out a warning via snomask +l if a server #
@@ -928,6 +932,7 @@
hidemodes="eI"
quietbursts="yes"
pingwarning="15"
+ serverpingfreq="60"
allowhalfop="yes"
defaultmodes="nt"
moronbanner="You're banned! Email haha@abuse.com with the ERROR line below for help."
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 2b159fa4e..3d472bf7a 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -485,7 +485,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
if (serv->AnsweredLastPing())
{
sock->WriteLine(std::string(":")+ServerInstance->Config->ServerName+" PING "+serv->GetName());
- serv->SetNextPingTime(curtime + 60);
+ serv->SetNextPingTime(curtime + Utils->PingFreq);
serv->LastPing = curtime;
timeval t;
gettimeofday(&t, NULL);
@@ -503,7 +503,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
return;
}
}
- else if ((Utils->PingWarnTime) && (!serv->Warned) && (curtime >= serv->NextPingTime() - (60 - Utils->PingWarnTime)) && (!serv->AnsweredLastPing()))
+ else if ((Utils->PingWarnTime) && (!serv->Warned) && (curtime >= serv->NextPingTime() - (Utils->PingFreq - 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);
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index b5cac1802..d13075f0f 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -67,7 +67,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
{
VersionString.clear();
UserCount = OperCount = 0;
- this->SetNextPingTime(time(NULL) + 60);
+ this->SetNextPingTime(time(NULL) + Utils->PingFreq);
this->SetPingFlag();
rtt = LastPing = 0;
/* find the 'route' for this server (e.g. the one directly connected
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index fc6853ba8..88c7666bf 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -1111,7 +1111,7 @@ bool TreeSocket::ProcessLine(std::string &line)
* 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) + 60);
+ route_back_again->SetNextPingTime(time(NULL) + Utils->PingFreq);
route_back_again->SetPingFlag();
}
else
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index bfd46ef03..1c54c5a68 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -498,8 +498,12 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
ChallengeResponse = !Conf->ReadFlag("options", "disablehmac", 0);
quiet_bursts = Conf->ReadFlag("options", "quietbursts", 0);
PingWarnTime = Conf->ReadInteger("options", "pingwarning", 0, true);
+ PingFreq = Conf->ReadInteger("options", "serverpingfreq", 0, true);
- if (PingWarnTime < 0 || PingWarnTime > 59)
+ if (PingFreq == 0)
+ PingFreq = 60;
+
+ if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1)
PingWarnTime = 0;
LinkBlocks.clear();
diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h
index cb783a81a..3a36a2e20 100644
--- a/src/modules/m_spanningtree/utils.h
+++ b/src/modules/m_spanningtree/utils.h
@@ -123,6 +123,10 @@ class SpanningTreeUtilities
*/
bool ChallengeResponse;
+ /** Ping frequency of server to server links
+ */
+ int PingFreq;
+
/** Initialise utility class
*/
SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningTree* Creator);