From b8015b09dcf4b49ceb695b188a2172548378e1db Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 9 May 2007 23:42:06 +0000 Subject: Fix ping timeout ERROR not being generated when a server pings out, making the other end appear to be closed unexpectedly without reason. Find and fix the 3 ping timeout messages for server to server that were using WriteOpers instead of snomask +l git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6933 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 1 + src/modules/m_spanningtree/treesocket1.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 48b76b8a0..09574f15f 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -468,6 +468,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) { // they didnt answer, boot them ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 pinged out",serv->GetName().c_str()); + sock->SendError("Ping timeout"); sock->Squit(serv,"Ping timeout"); ServerInstance->SE->DelFd(sock); sock->Close(); diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 76b7896a5..ddfc2f18e 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -394,8 +394,11 @@ std::string TreeSocket::ListDifference(const std::string &one, const std::string void TreeSocket::SendError(const std::string &errormessage) { + /* Display the error locally as well as sending it remotely */ this->WriteLine("ERROR :"+errormessage); this->Instance->SNO->WriteToSnoMask('l',"Sent \2ERROR\2 to "+this->InboundServerName+": "+errormessage); + /* One last attempt to make sure the error reaches its target */ + this->FlushWriteBuffer(); } bool TreeSocket::Capab(const std::deque ¶ms) @@ -568,11 +571,11 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) Utils->DoOneToAllButSender(Current->GetParent()->GetName(),"SQUIT",params,Current->GetName()); if (Current->GetParent() == Utils->TreeRoot) { - this->Instance->WriteOpers("Server \002"+Current->GetName()+"\002 split: "+reason); + this->Instance->SNO->WriteToSnoMask('l',"Server \002"+Current->GetName()+"\002 split: "+reason); } else { - this->Instance->WriteOpers("Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason); + this->Instance->SNO->WriteToSnoMask('l',"Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason); } num_lost_servers = 0; num_lost_users = 0; @@ -581,12 +584,10 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) Current->Tidy(); Current->GetParent()->DelChild(Current); DELETE(Current); - this->Instance->WriteOpers("Netsplit complete, lost \002%d\002 users on \002%d\002 servers.", num_lost_users, num_lost_servers); + this->Instance->SNO->WriteToSnoMask('l',"Netsplit complete, lost \002%d\002 users on \002%d\002 servers.", num_lost_users, num_lost_servers); } else - { Instance->Log(DEFAULT,"Squit from unknown server"); - } } /** FMODE command - server mode with timestamp checks */ -- cgit v1.2.3