Skip to content

Commit

Permalink
Prevent race condition in DTLS media stop (#3901)
Browse files Browse the repository at this point in the history
  • Loading branch information
sauwming authored Mar 26, 2024
1 parent 427a2b3 commit c0de1a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pjmedia/src/pjmedia/transport_srtp_dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,8 +1890,10 @@ static pj_status_t dtls_media_stop(pjmedia_transport *tp)
PJ_LOG(2,(ds->base.name, "dtls_media_stop()"));
#endif

DTLS_LOCK(ds);
dtls_media_stop_channel(ds, RTP_CHANNEL);
dtls_media_stop_channel(ds, RTCP_CHANNEL);
DTLS_UNLOCK(ds);

ds->setup = DTLS_SETUP_UNKNOWN;
ds->use_ice = PJ_FALSE;
Expand Down

0 comments on commit c0de1a4

Please sign in to comment.