Skip to content

Commit

Permalink
turn_sock: do not cleanup while binding
Browse files Browse the repository at this point in the history
Upstream issue: pjsip/pjproject#3776

This is a workaround, hoping it will be fixed upstream. I don't
have a clean fix right now

Change-Id: I500cd01c0ee58de5ef1a57bef5ab603a9f9669f6
  • Loading branch information
Sébastien Blin committed Dec 20, 2023
1 parent 235ae6e commit 68be61f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pjnath/src/pjnath/turn_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,12 @@ static pj_bool_t dataconn_on_data_read(pj_activesock_t *asock,

if (size == 0 && status != PJ_SUCCESS) {
/* Connection gone, release data connection */
dataconn_cleanup(conn);
--turn_sock->data_conn_cnt;
if (conn->state == DATACONN_STATE_CONN_BINDING) {
// TODO cancel request (and do not cleanup there)
} else if (conn->state == DATACONN_STATE_READY) {
dataconn_cleanup(conn);
--turn_sock->data_conn_cnt;
}
pj_grp_lock_release(turn_sock->grp_lock);
return PJ_FALSE;
}
Expand Down

0 comments on commit 68be61f

Please sign in to comment.