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/threadengines/threadengine_win32.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/threadengines/threadengine_win32.cpp')
-rw-r--r-- | src/threadengines/threadengine_win32.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp index 5c62b5081..fab75699e 100644 --- a/src/threadengines/threadengine_win32.cpp +++ b/src/threadengines/threadengine_win32.cpp @@ -55,20 +55,15 @@ class ThreadSignalSocket : public BufferedSocket { SocketThread* parent; public: - ThreadSignalSocket(SocketThread* t, InspIRCd* SI, int newfd, const char* ip) - : BufferedSocket(SI, newfd, ip), parent(t) + ThreadSignalSocket(SocketThread* t, int newfd) + : BufferedSocket(newfd), parent(t) { } - virtual bool OnDataReady() + void OnDataReady() { - char data = 0; - if (ServerInstance->SE->Recv(this, &data, 1, 0) > 0) - { - parent->OnNotify(); - return true; - } - return false; + recvq.clear(); + parent->OnNotify(); } }; @@ -92,7 +87,7 @@ SocketThread::SocketThread(InspIRCd* SI) int nfd = accept(listenFD); if (nfd < 0) throw CoreException("Could not create ITC pipe"); - new ThreadSignalSocket(parent, ServerInstance, nfd, "127.0.0.1"); + new ThreadSignalSocket(parent, nfd); closesocket(listenFD); SI->SE->Blocking(connFD); |