]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add CAP REQ tls support, thanks to psychon
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 28 Aug 2008 15:34:22 +0000 (15:34 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 28 Aug 2008 15:34:22 +0000 (15:34 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10332 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/extra/m_ssl_gnutls.cpp

index 86e726189a5ca973925ac0450ec5987e1340e732..63d3d1a2d808e4e425d920de4823e2d2a2722e58 100644 (file)
@@ -920,6 +920,19 @@ class ModuleSSLGnuTLS : public Module
        void OnEvent(Event* ev)
        {
                GenericCapHandler(ev, "tls", "tls");
+               if (ev->GetEventID() == "cap_req")
+               {
+                       /* GenericCapHandler() Extends("tls") a user if it does
+                        * CAP REQ tls. Check if this was done.
+                        */
+                       CapData *data = (CapData *) ev->GetData();
+                       if (data->user->Shrink("tls"))
+                       {
+                               data->user->io = this;
+                               OnRawSocketAccept(data->user->GetFd(), data->user->GetIPString(),
+                                               data->user->GetPort());
+                       }
+               }
        }
 
        void Prioritize()