Module: kamailio
Branch: master
Commit: 2df6fd2b92c95791fa299500680a31814f95291c
URL: 
https://github.com/kamailio/kamailio/commit/2df6fd2b92c95791fa299500680a31814f95291c

Author: S-P Chan <shihping.c...@gmail.com>
Committer: S-P Chan <shihping.c...@gmail.com>
Date: 2024-12-20T17:01:03+08:00

tls: warn if thread-locals are initialized before this module

---

Modified: src/modules/tls/tls_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2df6fd2b92c95791fa299500680a31814f95291c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2df6fd2b92c95791fa299500680a31814f95291c.patch

---

diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c
index 1cc8a9540da..1d7169b27e6 100644
--- a/src/modules/tls/tls_mod.c
+++ b/src/modules/tls/tls_mod.c
@@ -401,6 +401,14 @@ static int mod_init(void)
                return -1;
        }
 #endif
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L
+       for(k = 0; k < 32; k++) {
+               if(pthread_getspecific(k) != 0) {
+                       LM_WARN("detected initialized thread-locals created 
before tls.so; "
+                                       "tls.so must be the first module 
loaded\n");
+               }
+       }
+#endif /*  OPENSSL_VERSION_NUMBER*/
 
        if(tls_disable) {
                LM_WARN("tls support is disabled "

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to