Skip to content

Commit 07e4feb

Browse files
committed
[proto_hep] avoid hard dependency to tls_mgm
Load the tls_mgm module ONLY if a TLS HEP socket is defined
1 parent 9c27ae4 commit 07e4feb

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

modules/proto_hep/doc/proto_hep_admin.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ socket= hep_udp:127.0.0.1:6061 # change the listening IP
4040
<itemizedlist>
4141
<listitem>
4242
<para>
43-
<emphasis>None</emphasis>.
43+
<emphasis>tls_mgm</emphasis> - optional, only if a TLS based
44+
HEP listener is defined in the script.
4445
</para>
4546
</listitem>
4647
</itemizedlist>

modules/proto_hep/proto_hep.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ static int mod_init(void)
199199
return -1;
200200
}
201201

202+
if (protos[PROTO_HEP_TLS].listeners && load_tls_mgm_api(&tls_mgm_api)!=0) {
203+
LM_DBG("failed to find TLS API - is tls_mgm module loaded?\n");
204+
return -1;
205+
}
206+
202207
if (payload_compression) {
203208
load_compression =
204209
(load_compression_f)find_export("load_compression", 0);
@@ -304,10 +309,6 @@ static int proto_hep_init_tcp(struct proto_info* pi)
304309

305310
static int proto_hep_init_tls(struct proto_info* pi)
306311
{
307-
if (load_tls_mgm_api(&tls_mgm_api) != 0) {
308-
LM_DBG("failed to find TLS API - is tls_mgm module loaded?\n");
309-
return -1;
310-
}
311312

312313
pi->id = PROTO_HEP_TLS;
313314
pi->name = "hep_tls";

0 commit comments

Comments
 (0)