Module: kamailio
Branch: master
Commit: 1fe36fa983b8f271165750977120d758faf84d01
URL:
https://github.com/kamailio/kamailio/commit/1fe36fa983b8f271165750977120d75…
Author: Camille Oudot <camille.oudot(a)orange.com>
Committer: Camille Oudot <camille.oudot(a)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/1fe36fa983b8f271165750977120d75…
Patch:
https://github.com/kamailio/kamailio/commit/1fe36fa983b8f271165750977120d75…
---
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