]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix for bug #347.
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 11 Jul 2007 16:59:10 +0000 (16:59 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 11 Jul 2007 16:59:10 +0000 (16:59 +0000)
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

src/inspsocket.cpp
src/modules/m_httpd.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/rsquit.cpp

index c2b80a225d7d2d73dd6726bc7e867330417ad573..f29366c73bad71ab7b400309f0b939f0ff9feabc 100644 (file)
@@ -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;
 }
index d033b227011c99b49b0c14826560276322f7ebea..8494863a3f4b4597471d6e6181936536b009e271 100644 (file)
@@ -344,7 +344,6 @@ void HttpServerTimeout::Tick(time_t TIME)
 {
        SE->DelFd(s);
        s->Close();
-       delete s;
 }
 
 class ModuleHttpServer : public Module
index b5de84701be0e0fa7a64d10b7a288c1d32d3651e..1cc18dae6f1e46cc145816225ff0730735722214 100644 (file)
@@ -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;
                                }
                        }
index aa4f924bef1d27deacacdc88c0416e4eb83bf264..5f3d33fc0680915b2d677ea3d5c9454658d7841c 100644 (file)
@@ -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;
                        }
                }