]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_gnutls.cpp
Extra checks to not set the ssl marker twice on re-handshake (nonfatal but wasteful)
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_gnutls.cpp
index 12ecf18ebe384e5134f32ea2a34d446899077224..93b904958c4fac7437b1e827c3f4f8fef4654236 100644 (file)
@@ -13,7 +13,7 @@
 
 /* $ModDesc: Provides SSL support for clients */
 /* $CompileFlags: `libgnutls-config --cflags` */
-/* $LinkerFlags: `libgnutls-config --libs` */
+/* $LinkerFlags: `libgnutls-config --libs` `perl ../gnutls_rpath.pl` */
 
 enum issl_status { ISSL_NONE, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, ISSL_HANDSHAKEN, ISSL_CLOSING, ISSL_CLOSED };
 
@@ -525,7 +525,11 @@ class ModuleSSLGnuTLS : public Module
                        
                        // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater.
                        userrec* extendme = Srv->FindDescriptor(session->fd);
-                       extendme->Extend("ssl", "ON");
+                       if (extendme)
+                       {
+                               if (!extendme->GetExt("ssl"))
+                                       extendme->Extend("ssl", "ON");
+                       }
 
                        // Change the seesion state
                        session->status = ISSL_HANDSHAKEN;