summaryrefslogtreecommitdiff
path: root/res/res_pjsip/config_transport.c
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2015-12-12 10:08:50 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2015-12-12 10:12:22 -0700
commit5b867fa9043dec7aee8fbe21a6537efb103e4d92 (patch)
treebbf97a87268ba089a48501bcc4b6849ed649a97f /res/res_pjsip/config_transport.c
parent14b41115e363766633aec67f67e9764521b74f5c (diff)
pjsip/config_transport: Check pjproject version at runtime for async ops
pjproject < 2.5.0 will segfault on a tls transport if async_operations is greater than 1. A runtime version check has been added to throw an error if the version is < 2.5.0 and async_operations > 1. To assist in the check, a new api "ast_compare_versions" was added to utils which compares 2 major.minor.patch.extra version strings. ASTERISK-25615 #close Change-Id: I8e88bb49cbcfbca88d9de705496d6f6a8c938a98 Reported-by: George Joseph Tested-by: George Joseph
Diffstat (limited to 'res/res_pjsip/config_transport.c')
-rw-r--r--res/res_pjsip/config_transport.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index d8ece1509..840824bd9 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -217,11 +217,8 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj)
res = pjsip_tcp_transport_start3(ast_sip_get_pjsip_endpoint(), &cfg, &transport->state->factory);
} else if (transport->type == AST_TRANSPORT_TLS) {
- /* The following check is a work-around for ASTERISK-25615.
- * When that issue is resolved in upstream pjproject, this check can be removed.
- */
- if (transport->async_operations > 1) {
- ast_log(LOG_ERROR, "Transport: %s: When protocol=tls, async_operations can't be > 1 (ASTERISK-25615)\n",
+ if (transport->async_operations > 1 && ast_compare_versions(pj_get_version(), "2.5.0") < 0) {
+ ast_log(LOG_ERROR, "Transport: %s: When protocol=tls and pjproject version < 2.5.0, async_operations can't be > 1\n",
ast_sorcery_object_get_id(obj));
return -1;
}