mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
More cleanup of quit servers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12394 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
60805faa36
commit
d1b146808e
@ -151,6 +151,13 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
|
||||
{
|
||||
TreeServer *s = i->second;
|
||||
|
||||
if (s->GetSocket() && s->GetSocket()->GetLinkState() == DYING)
|
||||
{
|
||||
s->GetSocket()->SendError("Ping timeout");
|
||||
s->GetSocket()->Squit(s,"Ping timeout");
|
||||
s->GetSocket()->Close();
|
||||
}
|
||||
|
||||
// Fix for bug #792, do not ping servers that are not connected yet!
|
||||
// Remote servers have Socket == NULL and local connected servers have
|
||||
// Socket->LinkState == CONNECTED
|
||||
|
@ -461,20 +461,14 @@ std::string TreeSocket::GetName()
|
||||
}
|
||||
|
||||
void TreeSocket::OnTimeout()
|
||||
{
|
||||
if (this->LinkState == CONNECTING)
|
||||
{
|
||||
ServerInstance->SNO->WriteGlobalSno('l', "CONNECT: Connection to \002%s\002 timed out.", myhost.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void TreeSocket::Close()
|
||||
{
|
||||
this->BufferedSocket::Close();
|
||||
|
||||
// Test fix for big fuckup
|
||||
if (this->LinkState != CONNECTED)
|
||||
return;
|
||||
SetError("Remote host closed connection");
|
||||
|
||||
// Connection closed.
|
||||
// If the connection is fully up (state CONNECTED)
|
||||
@ -485,9 +479,9 @@ void TreeSocket::Close()
|
||||
quitserver = this->InboundServerName;
|
||||
}
|
||||
TreeServer* s = Utils->FindServer(quitserver);
|
||||
if (s)
|
||||
if (s && s->GetSocket() == this)
|
||||
{
|
||||
Squit(s,"Remote host closed the connection");
|
||||
Squit(s,getError());
|
||||
}
|
||||
|
||||
if (!quitserver.empty())
|
||||
|
Loading…
x
Reference in New Issue
Block a user