From 90930619bc124e94bac5048c0b13c3f4748b559d Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 1 Nov 2012 13:32:38 -0400 Subject: Fixed quite a bit of dumbness with m_ssl. Had to modify socketengines to allow polling for write & no read, but is it cleaner now. Made m_httpd able to listen using SSL. --- include/socketengine.h | 22 +++++----------------- include/sockets.h | 1 + 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/socketengine.h b/include/socketengine.h index 0cffec6b3..6cf49baa0 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -16,6 +16,7 @@ class CoreExport SocketEngine { + static const int DefaultSize = 4; // Uplink, DNS, Signal handler, Mode stacker public: /* Map of sockets */ static std::map Sockets; @@ -28,25 +29,12 @@ class CoreExport SocketEngine */ static void Shutdown(); - /** Add a socket to the internal list + /** Set a flag on a socket * @param s The socket + * @param set Whether setting or unsetting + * @param flag The flag to set or unset */ - static void AddSocket(Socket *s); - - /** Delete a socket from the internal list - * @param s The socket - */ - static void DelSocket(Socket *s); - - /** Mark a socket as writeable - * @param s The socket - */ - static void MarkWritable(Socket *s); - - /** Unmark a socket as writeable - * @param s The socket - */ - static void ClearWritable(Socket *s); + static void Change(Socket *s, bool set, SocketFlag flag); /** Read from sockets and do things */ diff --git a/include/sockets.h b/include/sockets.h index ea59346db..7074522e0 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -110,6 +110,7 @@ class SocketException : public CoreException enum SocketFlag { SF_DEAD, + SF_READABLE, SF_WRITABLE, SF_CONNECTING, SF_CONNECTED, -- cgit