From ed6176383eef5de23a62c7de70b58b8d80239005 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 8 Feb 2014 13:16:31 +0100 Subject: Replace SocketEngine::GetName() with INSPIRCD_SOCKETENGINE_NAME define --- configure | 1 + include/socketengine.h | 6 ------ src/modules/m_httpd_stats.cpp | 2 +- src/server.cpp | 2 +- src/socketengines/socketengine_epoll.cpp | 6 ------ src/socketengines/socketengine_kqueue.cpp | 6 ------ src/socketengines/socketengine_poll.cpp | 6 ------ src/socketengines/socketengine_ports.cpp | 6 ------ src/socketengines/socketengine_select.cpp | 6 ------ win/config.h.cmake | 1 + 10 files changed, 4 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 2f92d9f16..4db9064b9 100755 --- a/configure +++ b/configure @@ -455,6 +455,7 @@ sub writefiles { #define VERSION "$version" #define REVISION "$revision" #define SYSTEM "$incos" +#define INSPIRCD_SOCKETENGINE_NAME "$config{SOCKETENGINE}" #define CONFIG_PATH "$config{CONFIG_DIR}" #define DATA_PATH "$config{DATA_DIR}" diff --git a/include/socketengine.h b/include/socketengine.h index b57113af0..a2179d951 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -358,12 +358,6 @@ public: */ virtual void DispatchTrialWrites(); - /** Returns the socket engines name. This returns the name of the - * engine for use in /VERSION responses. - * @return The socket engine name - */ - virtual std::string GetName() = 0; - /** Returns true if the file descriptors in the given event handler are * within sensible ranges which can be handled by the socket engine. */ diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 11809e893..e94ee2504 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -107,7 +107,7 @@ class ModuleHttpStats : public Module data << "" << ServerInstance->Users->clientlist->size() << ""; data << "" << ServerInstance->chanlist->size() << ""; data << "" << ServerInstance->Users->all_opers.size() << ""; - data << "" << (ServerInstance->SE->GetUsedFds()) << "" << ServerInstance->SE->GetMaxFds() << "" << ServerInstance->SE->GetName() << ""; + data << "" << (ServerInstance->SE->GetUsedFds()) << "" << ServerInstance->SE->GetMaxFds() << "" INSPIRCD_SOCKETENGINE_NAME ""; time_t current_time = 0; current_time = ServerInstance->Time(); diff --git a/src/server.cpp b/src/server.cpp index 1d1f52641..5590f05f9 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -68,7 +68,7 @@ void InspIRCd::Rehash(const std::string& uuid) std::string InspIRCd::GetVersionString(bool getFullVersion) { if (getFullVersion) - return VERSION " " + Config->ServerName + " :" SYSTEM " [" REVISION "," + SE->GetName() + "," + Config->sid + "]"; + return VERSION " " + Config->ServerName + " :" SYSTEM " [" REVISION "," INSPIRCD_SOCKETENGINE_NAME "," + Config->sid + "]"; return BRANCH " " + Config->ServerName + " :" + Config->CustomVersion; } diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index 09fa918c6..800cc7657 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -49,7 +49,6 @@ public: virtual void OnSetEvent(EventHandler* eh, int old_mask, int new_mask); virtual void DelFd(EventHandler* eh); virtual int DispatchEvents(); - virtual std::string GetName(); }; EPollEngine::EPollEngine() : events(1) @@ -255,11 +254,6 @@ int EPollEngine::DispatchEvents() return i; } -std::string EPollEngine::GetName() -{ - return "epoll"; -} - SocketEngine* CreateSocketEngine() { return new EPollEngine; diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index 07ea19d9d..53bd741f0 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -51,7 +51,6 @@ public: void OnSetEvent(EventHandler* eh, int old_mask, int new_mask); virtual void DelFd(EventHandler* eh); virtual int DispatchEvents(); - virtual std::string GetName(); virtual void RecoverFromFork(); }; @@ -255,11 +254,6 @@ int KQueueEngine::DispatchEvents() return i; } -std::string KQueueEngine::GetName() -{ - return "kqueue"; -} - SocketEngine* CreateSocketEngine() { return new KQueueEngine; diff --git a/src/socketengines/socketengine_poll.cpp b/src/socketengines/socketengine_poll.cpp index 2919988c0..53953626f 100644 --- a/src/socketengines/socketengine_poll.cpp +++ b/src/socketengines/socketengine_poll.cpp @@ -60,7 +60,6 @@ public: virtual void OnSetEvent(EventHandler* eh, int old_mask, int new_mask); virtual void DelFd(EventHandler* eh); virtual int DispatchEvents(); - virtual std::string GetName(); }; PollEngine::PollEngine() : events(1), fd_mappings(1) @@ -246,11 +245,6 @@ int PollEngine::DispatchEvents() return i; } -std::string PollEngine::GetName() -{ - return "poll"; -} - SocketEngine* CreateSocketEngine() { return new PollEngine; diff --git a/src/socketengines/socketengine_ports.cpp b/src/socketengines/socketengine_ports.cpp index 098e75116..74c36712b 100644 --- a/src/socketengines/socketengine_ports.cpp +++ b/src/socketengines/socketengine_ports.cpp @@ -54,7 +54,6 @@ public: virtual void OnSetEvent(EventHandler* eh, int old_mask, int new_mask); virtual void DelFd(EventHandler* eh); virtual int DispatchEvents(); - virtual std::string GetName(); }; PortsEngine::PortsEngine() : events(1) @@ -194,11 +193,6 @@ int PortsEngine::DispatchEvents() return (int)i; } -std::string PortsEngine::GetName() -{ - return "ports"; -} - SocketEngine* CreateSocketEngine() { return new PortsEngine; diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp index 82fe0bb6b..e9d7a9660 100644 --- a/src/socketengines/socketengine_select.cpp +++ b/src/socketengines/socketengine_select.cpp @@ -41,7 +41,6 @@ public: virtual void DelFd(EventHandler* eh); void OnSetEvent(EventHandler* eh, int, int); virtual int DispatchEvents(); - virtual std::string GetName(); }; SelectEngine::SelectEngine() @@ -173,11 +172,6 @@ int SelectEngine::DispatchEvents() return sresult; } -std::string SelectEngine::GetName() -{ - return "select"; -} - SocketEngine* CreateSocketEngine() { return new SelectEngine; diff --git a/win/config.h.cmake b/win/config.h.cmake index 081163fab..3a34a706b 100644 --- a/win/config.h.cmake +++ b/win/config.h.cmake @@ -4,6 +4,7 @@ #define VERSION "@FULL_VERSION@" #define REVISION "release" #define SYSTEM "@CMAKE_SYSTEM@" +#define INSPIRCD_SOCKETENGINE_NAME "select" #define CONFIG_PATH "@CONF_PATH@" #define MOD_PATH "@MODULE_PATH@" -- cgit v1.2.3