pjproject: avoid to cancel succesful connection

The timer is triggered through a passive candidate, so it should
be done only if the timer is none.

Change-Id: I89a16467667393949ad38b4184b4edfb0a452675
This commit is contained in:
Sébastien Blin
2020-04-07 10:28:57 -04:00
parent 3335829585
commit 04acab5a32

View File

@ -669,7 +669,7 @@ index fff4fad26..e7f8b84eb 100644
if (status != PJ_SUCCESS && status != PJ_EPENDING) {
app_perror(" error: server sending data", status);
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index 2a4125bc5..526c8e13f 100644
index 2a4125bc5..d2eae9494 100644
--- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c
@@ -18,6 +18,7 @@
@ -966,10 +966,10 @@ index 2a4125bc5..526c8e13f 100644
+ case PJ_CAND_TCP_SO:
+ default:
+ if (lcand->type == PJ_ICE_CAND_TYPE_RELAYED) {
+ pj_timer_heap_cancel_if_active(ice->stun_cfg.timer_heap,
+ &ice->timer, TIMER_NONE);
+ status = (*ice->cb.select_turn_dataconn)(ice, clist, check_id);
+ if (ice->timer.id == TIMER_NONE) {
+ pj_timer_heap_cancel_if_active(ice->stun_cfg.timer_heap,
+ &ice->timer, TIMER_NONE);
+ pj_time_val delay = {
+ .sec = 0,
+ .msec = 1500
@ -4127,4 +4127,4 @@ index 474a8d07c..9257f07a4 100644
+ sess->af, PJ_STUN_TP_UDP, &stun_sock_cb,
NULL, sess, &sess->stun_sock);
if (status != PJ_SUCCESS) {
char errmsg[PJ_ERR_MSG_SIZE];
char errmsg[PJ_ERR_MSG_SIZE];