Skip to content

Commit

Permalink
Fixed race condition between TURN session destroy and incoming data p…
Browse files Browse the repository at this point in the history
…rocessing
  • Loading branch information
sauwming committed Oct 9, 2023
1 parent 4f8b751 commit eac16d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pjnath/src/pjnath/turn_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,7 @@ static void turn_on_state(pj_turn_session *sess,
*/
}

pj_grp_lock_acquire(turn_sock->grp_lock);
if (new_state >= PJ_TURN_STATE_DESTROYING && turn_sock->sess) {
pj_time_val delay = {0, 0};

Expand All @@ -1478,6 +1479,7 @@ static void turn_on_state(pj_turn_session *sess,
&delay, TIMER_DESTROY,
turn_sock->grp_lock);
}
pj_grp_lock_release(turn_sock->grp_lock);
}


Expand Down

0 comments on commit eac16d5

Please sign in to comment.