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/socketengines/socketengine_epoll.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/socketengines/socketengine_epoll.cpp')
-rw-r--r-- | src/socketengines/socketengine_epoll.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index 1be0d7cd2..7fed6f250 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -16,7 +16,7 @@ #include "socketengines/socketengine_epoll.h" #include <ulimit.h> -EPollEngine::EPollEngine(InspIRCd* Instance) : SocketEngine(Instance) +EPollEngine::EPollEngine() { MAX_DESCRIPTORS = 0; // This is not a maximum, just a hint at the eventual number of sockets that may be polled. @@ -45,7 +45,7 @@ EPollEngine::~EPollEngine() delete[] events; } -bool EPollEngine::AddFd(EventHandler* eh) +bool EPollEngine::AddFd(EventHandler* eh, bool writeFirst) { int fd = eh->GetFd(); if ((fd < 0) || (fd > GetMaxFds() - 1)) @@ -68,7 +68,7 @@ bool EPollEngine::AddFd(EventHandler* eh) struct epoll_event ev; memset(&ev,0,sizeof(ev)); - eh->Readable() ? ev.events = EPOLLIN : ev.events = EPOLLOUT; + ev.events = writeFirst ? EPOLLOUT : EPOLLIN; ev.data.fd = fd; int i = epoll_ctl(EngineHandle, EPOLL_CTL_ADD, fd, &ev); if (i < 0) @@ -107,7 +107,6 @@ bool EPollEngine::DelFd(EventHandler* eh, bool force) struct epoll_event ev; memset(&ev,0,sizeof(ev)); - eh->Readable() ? ev.events = EPOLLIN : ev.events = EPOLLOUT; ev.data.fd = fd; int i = epoll_ctl(EngineHandle, EPOLL_CTL_DEL, fd, &ev); |