[Asterisk-code-review] transport management: Register thread with PJProject. (asterisk[certified/13.1])
Mark Michelson
asteriskteam at digium.com
Thu Apr 14 13:55:18 CDT 2016
Mark Michelson has uploaded a new change for review.
https://gerrit.asterisk.org/2615
Change subject: transport management: Register thread with PJProject.
......................................................................
transport management: Register thread with PJProject.
The scheduler thread that kills idle TCP connections was not registering
with PJProject properly and causing assertions if PJProject was built in
debug mode.
This change registers the thread with PJProject the first time that the
scheduler callback executes.
AST-2016-005
Change-Id: I5f7a37e2c80726a99afe9dc2a4a69bdedf661283
---
M res/res_pjsip_transport_management.c
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/2615/1
diff --git a/res/res_pjsip_transport_management.c b/res/res_pjsip_transport_management.c
index ddde69d..2ae2873 100644
--- a/res/res_pjsip_transport_management.c
+++ b/res/res_pjsip_transport_management.c
@@ -106,6 +106,15 @@
struct monitored_transport *keepalive = (struct monitored_transport *) data;
int sip_received = ast_atomic_fetchadd_int(&keepalive->sip_received, 0);
+ if (!pj_thread_is_registered()) {
+ pj_thread_t *thread;
+ pj_thread_desc desc;
+
+ pj_bzero(desc, sizeof(desc));
+
+ pj_thread_register("Transport Monitor", desc, &thread);
+ }
+
if (!sip_received) {
ast_log(LOG_NOTICE, "Shutting down transport '%s' since no request was received in %d seconds\n",
keepalive->transport->info, IDLE_TIMEOUT);
--
To view, visit https://gerrit.asterisk.org/2615
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f7a37e2c80726a99afe9dc2a4a69bdedf661283
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.1
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-code-review
mailing list