From e2af2347fc035d702e45f12e772223a8d578410d Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 21 Sep 2009 13:26:31 +0000 Subject: Create StreamSocket for IO hooking implementation Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 1b23bff02..704fec475 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -110,7 +110,6 @@ void InspIRCd::Cleanup() { User* u = *i++; Users->QuitUser(u, "Server shutdown"); - u->CloseSocket(); } /* We do this more than once, so that any service providers get a @@ -323,7 +322,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : * THIS MUST MATCH ORDER OF DECLARATION OF THE HandleWhateverFunc classes * within class InspIRCd. */ - HandleProcessUser(this), HandleIsNick(this), HandleIsIdent(this), HandleFloodQuitUser(this), @@ -336,7 +334,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : * THIS MUST MATCH THE ORDER OF DECLARATION OF THE FUNCTORS, e.g. the methods * themselves within the class. */ - ProcessUser(&HandleProcessUser), IsChannel(&HandleIsChannel), IsSID(&HandleIsSID), Rehash(&HandleRehash), @@ -387,9 +384,8 @@ InspIRCd::InspIRCd(int argc, char** argv) : // This must be created first, so other parts of Insp can use it while starting up this->Logs = new LogManager(this); - SocketEngineFactory* SEF = new SocketEngineFactory(); - SE = SEF->Create(this); - delete SEF; + SocketEngineFactory SEF; + SE = SEF.Create(); this->Threads = new ThreadEngine(this); @@ -832,9 +828,6 @@ int InspIRCd::Run() /* if any users were quit, take them out */ this->GlobalCulls.Apply(); - /* If any inspsockets closed, remove them */ - this->BufferedSocketCull(); - if (this->s_signal) { this->SignalHandler(s_signal); @@ -845,18 +838,6 @@ int InspIRCd::Run() return 0; } -void InspIRCd::BufferedSocketCull() -{ - for (std::map::iterator x = SocketCull.begin(); x != SocketCull.end(); ++x) - { - this->Logs->Log("MISC",DEBUG,"Cull socket"); - SE->DelFd(x->second); - x->second->Close(); - delete x->second; - } - SocketCull.clear(); -} - /**********************************************************************************/ /** -- cgit v1.2.3