summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-11 16:59:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-11 16:59:10 +0000
commite93cdf5a66ef90b0b0ea64c80c7e4eebdecb55c9 (patch)
tree348bf916883e211f5850284b1048f79cb609fcf7 /src
parentbf517cb0ad1a1302ff828dbe27691a0b355720b2 (diff)
Fix for bug #347.
WARNING: QA PEOPLE, THIS NEEDS TESTING!!!! Test this with lots of squits and connects, and i mean lots and lots in all different ways you can think of, /squit, pingout, closing the connection with a firewall etc. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7434 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspsocket.cpp3
-rw-r--r--src/modules/m_httpd.cpp1
-rw-r--r--src/modules/m_spanningtree/main.cpp5
-rw-r--r--src/modules/m_spanningtree/rsquit.cpp1
4 files changed, 4 insertions, 6 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index c2b80a225..f29366c73 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -359,6 +359,9 @@ void InspSocket::Close()
this->OnClose();
shutdown(this->fd,2);
close(this->fd);
+
+ if (Instance->SocketCull.find(this) == Instance->SocketCull.end())
+ Instance->SocketCull[this] = this;
}
errno = save;
}
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index d033b2270..8494863a3 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -344,7 +344,6 @@ void HttpServerTimeout::Tick(time_t TIME)
{
SE->DelFd(s);
s->Close();
- delete s;
}
class ModuleHttpServer : public Module
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index b5de84701..1cc18dae6 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -405,7 +405,6 @@ int ModuleSpanningTree::HandleSquit(const char** parameters, int pcnt, userrec*
sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost());
ServerInstance->SE->DelFd(sock);
sock->Close();
- delete sock;
}
else
{
@@ -488,9 +487,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
/* they didnt answer, boot them */
sock->SendError("Ping timeout");
sock->Squit(serv,"Ping timeout");
- ServerInstance->SE->DelFd(sock);
- sock->Close();
- delete sock;
+ /*** XXX SOCKET CULL ***/
return;
}
}
diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp
index aa4f924be..5f3d33fc0 100644
--- a/src/modules/m_spanningtree/rsquit.cpp
+++ b/src/modules/m_spanningtree/rsquit.cpp
@@ -99,7 +99,6 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user)
sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost());
ServerInstance->SE->DelFd(sock);
sock->Close();
- delete sock;
return CMD_LOCALONLY;
}
}