mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 10:22:46 +00:00
Merge "chan_sip: Fix segfault during module unload" into 13
This commit is contained in:
@@ -2959,6 +2959,7 @@ static void *_sip_tcp_helper_thread(struct ast_tcptls_session_instance *tcptls_s
|
|||||||
if (!(me = sip_threadinfo_create(tcptls_session, tcptls_session->ssl ? AST_TRANSPORT_TLS : AST_TRANSPORT_TCP))) {
|
if (!(me = sip_threadinfo_create(tcptls_session, tcptls_session->ssl ? AST_TRANSPORT_TLS : AST_TRANSPORT_TCP))) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
me->threadid = pthread_self();
|
||||||
ao2_t_ref(me, +1, "Adding threadinfo ref for tcp_helper_thread");
|
ao2_t_ref(me, +1, "Adding threadinfo ref for tcp_helper_thread");
|
||||||
} else {
|
} else {
|
||||||
struct sip_threadinfo tmp = {
|
struct sip_threadinfo tmp = {
|
||||||
@@ -2966,8 +2967,13 @@ static void *_sip_tcp_helper_thread(struct ast_tcptls_session_instance *tcptls_s
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ((!(ca = tcptls_session->parent)) ||
|
if ((!(ca = tcptls_session->parent)) ||
|
||||||
(!(me = ao2_t_find(threadt, &tmp, OBJ_POINTER, "ao2_find, getting sip_threadinfo in tcp helper thread"))) ||
|
(!(me = ao2_t_find(threadt, &tmp, OBJ_POINTER, "ao2_find, getting sip_threadinfo in tcp helper thread")))) {
|
||||||
(!(tcptls_session = ast_tcptls_client_start(tcptls_session)))) {
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
me->threadid = pthread_self();
|
||||||
|
|
||||||
|
if (!(tcptls_session = ast_tcptls_client_start(tcptls_session))) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2978,7 +2984,6 @@ static void *_sip_tcp_helper_thread(struct ast_tcptls_session_instance *tcptls_s
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
me->threadid = pthread_self();
|
|
||||||
ast_debug(2, "Starting thread for %s server\n", tcptls_session->ssl ? "TLS" : "TCP");
|
ast_debug(2, "Starting thread for %s server\n", tcptls_session->ssl ? "TLS" : "TCP");
|
||||||
|
|
||||||
/* set up pollfd to watch for reads on both the socket and the alert_pipe */
|
/* set up pollfd to watch for reads on both the socket and the alert_pipe */
|
||||||
|
@@ -1799,7 +1799,6 @@ static void _urg_handler(int num)
|
|||||||
|
|
||||||
static struct sigaction urg_handler = {
|
static struct sigaction urg_handler = {
|
||||||
.sa_handler = _urg_handler,
|
.sa_handler = _urg_handler,
|
||||||
.sa_flags = SA_RESTART,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void _hup_handler(int num)
|
static void _hup_handler(int num)
|
||||||
|
Reference in New Issue
Block a user