diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-04-15 23:45:12 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-04-15 23:45:12 +0200 |
commit | dad754237bf28b9cb7733f7607e128569897eb10 (patch) | |
tree | c1c4bc48209ba6ea0c67f2e825c82bb87e3d30ea /src/modules | |
parent | 37de78450964b42741dffa51329251cdef28119f (diff) | |
parent | a42246b2f19d429a01fc901b7f49893764676499 (diff) |
Merge branch 'master+ehdispatch'
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 21 | ||||
-rw-r--r-- | src/modules/m_ident.cpp | 35 |
2 files changed, 19 insertions, 37 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 1e73c0143..ff8c1174c 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -178,18 +178,19 @@ class SQLConn : public SQLProvider, public EventHandler } } - void HandleEvent(EventType et, int errornum) + void OnEventHandlerRead() CXX11_OVERRIDE { - switch (et) - { - case EVENT_READ: - case EVENT_WRITE: - DoEvent(); - break; + DoEvent(); + } - case EVENT_ERROR: - DelayReconnect(); - } + void OnEventHandlerWrite() CXX11_OVERRIDE + { + DoEvent(); + } + + void OnEventHandlerError(int errornum) CXX11_OVERRIDE + { + DelayReconnect(); } std::string GetDSN() diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 959e58a47..0e5aa43ae 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -140,9 +140,8 @@ class IdentRequestSocket : public EventHandler } } - void OnConnected() + void OnEventHandlerWrite() CXX11_OVERRIDE { - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "OnConnected()"); SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE); char req[32]; @@ -163,30 +162,6 @@ class IdentRequestSocket : public EventHandler done = true; } - void HandleEvent(EventType et, int errornum = 0) - { - switch (et) - { - case EVENT_READ: - /* fd readable event, received ident response */ - ReadResponse(); - break; - case EVENT_WRITE: - /* fd writeable event, successfully connected! */ - OnConnected(); - break; - case EVENT_ERROR: - /* fd error event, ohshi- */ - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "EVENT_ERROR"); - /* We *must* Close() here immediately or we get a - * huge storm of EVENT_ERROR events! - */ - Close(); - done = true; - break; - } - } - void Close() { /* Remove ident socket from engine, and close it, but dont detatch it @@ -204,7 +179,7 @@ class IdentRequestSocket : public EventHandler return done; } - void ReadResponse() + void OnEventHandlerRead() CXX11_OVERRIDE { /* We don't really need to buffer for incomplete replies here, since IDENT replies are * extremely short - there is *no* sane reason it'd be in more than one packet @@ -264,6 +239,12 @@ class IdentRequestSocket : public EventHandler } } + void OnEventHandlerError(int errornum) CXX11_OVERRIDE + { + Close(); + done = true; + } + CullResult cull() CXX11_OVERRIDE { Close(); |