[sr-dev] git:master:1fe36fa9: tls: use multiprocess-safe shm_available()

Camille Oudot camille.oudot at orange.com
Wed Apr 15 11:19:15 CEST 2015


Module: kamailio
Branch: master
Commit: 1fe36fa983b8f271165750977120d758faf84d01
URL: https://github.com/kamailio/kamailio/commit/1fe36fa983b8f271165750977120d758faf84d01

Author: Camille Oudot <camille.oudot at orange.com>
Committer: Camille Oudot <camille.oudot at orange.com>
Date: 2015-04-14T19:41:38+02:00

tls: use multiprocess-safe shm_available()

under high load, the values returned by shm_available() can be inconsistent.
Use safe_shm_available() instead.

---

Modified: modules/tls/tls_server.c

---

Diff:  https://github.com/kamailio/kamailio/commit/1fe36fa983b8f271165750977120d758faf84d01.diff
Patch: https://github.com/kamailio/kamailio/commit/1fe36fa983b8f271165750977120d758faf84d01.patch

---

diff --git a/modules/tls/tls_server.c b/modules/tls/tls_server.c
index 1d86140..be020ec 100644
--- a/modules/tls/tls_server.c
+++ b/modules/tls/tls_server.c
@@ -59,10 +59,10 @@ int tls_run_event_routes(struct tcp_connection *c);
 /* low memory treshold for openssl bug #1491 workaround */
 #define LOW_MEM_NEW_CONNECTION_TEST() \
 	(cfg_get(tls, tls_cfg, low_mem_threshold1) && \
-	  (shm_available() < cfg_get(tls, tls_cfg, low_mem_threshold1)))
+	  (safe_shm_available() < cfg_get(tls, tls_cfg, low_mem_threshold1)))
 #define LOW_MEM_CONNECTED_TEST() \
 	(cfg_get(tls, tls_cfg, low_mem_threshold2) && \
-	  (shm_available() <  cfg_get(tls, tls_cfg, low_mem_threshold2)))
+	  (safe_shm_available() <  cfg_get(tls, tls_cfg, low_mem_threshold2)))
 
 #define TLS_RD_MBUF_SZ	65536
 #define TLS_WR_MBUF_SZ	65536




More information about the sr-dev mailing list