diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-21 13:26:31 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-21 13:26:31 +0000 |
commit | e2af2347fc035d702e45f12e772223a8d578410d (patch) | |
tree | bfd80aac2858a9f4faedc316794fc1051dbaa72c /src/socketengine.cpp | |
parent | 16fc672b685752007e47aed0fb97bc1ee7443c76 (diff) |
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
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r-- | src/socketengine.cpp | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp index af2f1b169..c0ae3f278 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -43,35 +43,7 @@ EventHandler::EventHandler() { - this->IOHook = NULL; -} - -bool EventHandler::AddIOHook(Module *IOHooker) -{ - if (this->IOHook) - return false; - - this->IOHook = IOHooker; - return true; -} - -bool EventHandler::DelIOHook() -{ - if (!this->IOHook) - return false; - - this->IOHook = NULL; - return true; -} - -Module *EventHandler::GetIOHook() -{ - return this->IOHook; -} - -int EventHandler::GetFd() -{ - return this->fd; + fd = -1; } void EventHandler::SetFd(int FD) @@ -79,21 +51,7 @@ void EventHandler::SetFd(int FD) this->fd = FD; } -bool EventHandler::Readable() -{ - return true; -} - -bool EventHandler::Writeable() -{ - return false; -} - -void SocketEngine::WantWrite(EventHandler* eh) -{ -} - -SocketEngine::SocketEngine(InspIRCd* Instance) : ServerInstance(Instance) +SocketEngine::SocketEngine() { TotalEvents = WriteEvents = ReadEvents = ErrorEvents = 0; lastempty = ServerInstance->Time(); @@ -104,11 +62,6 @@ SocketEngine::~SocketEngine() { } -bool SocketEngine::AddFd(EventHandler* eh) -{ - return true; -} - bool SocketEngine::HasFd(int fd) { if ((fd < 0) || (fd > MAX_DESCRIPTORS)) @@ -123,11 +76,6 @@ EventHandler* SocketEngine::GetRef(int fd) return ref[fd]; } -bool SocketEngine::DelFd(EventHandler* eh, bool force) -{ - return true; -} - int SocketEngine::GetMaxFds() { return 0; @@ -143,11 +91,6 @@ int SocketEngine::DispatchEvents() return 0; } -std::string SocketEngine::GetName() -{ - return "misconfigured"; -} - bool SocketEngine::BoundsCheckFd(EventHandler* eh) { if (!eh) |