From a693c96c88482216f7c4a8de9d3439d706040391 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 30 Jan 2006 22:34:22 +0000 Subject: Moved metadata code into into OnGlobalConnect git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2991 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 0ea713d00..c58db87bb 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -231,7 +231,7 @@ class ModuleSSLGnuTLS : public Module void Implements(char* List) { List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1; - List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = 1; + List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnGlobalConnect] = 1; } virtual void OnRawSocketAccept(int fd, std::string ip, int localport) @@ -526,6 +526,22 @@ class ModuleSSLGnuTLS : public Module userrec* extendme = Srv->FindDescriptor(session->fd); extendme->Extend("ssl", "ON"); + // Change the seesion state + session->status = ISSL_HANDSHAKEN; + + // Finish writing, if any left + MakePollWrite(session); + + return true; + } + } + + virtual void OnGlobalConnect(userrec* user) + { + // This occurs AFTER OnUserConnect so we can be sure the + // protocol module has propogated the NICK message. + if ((user->GetExt("ssl")) && (IS_LOCAL(user))) + { // Tell whatever protocol module we're using that we need to inform other servers of this metadata NOW. std::deque* metadata = new std::deque; metadata->push_back(extendme->nick); @@ -535,14 +551,6 @@ class ModuleSSLGnuTLS : public Module event->Send(); delete event; delete metadata; - - // Change the seesion state - session->status = ISSL_HANDSHAKEN; - - // Finish writing, if any left - MakePollWrite(session); - - return true; } } -- cgit v1.2.3