Skip to content

Commit 68be61f

Browse files
author
Sébastien Blin
committed
turn_sock: do not cleanup while binding
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
1 parent 235ae6e commit 68be61f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pjnath/src/pjnath/turn_sock.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -1587,8 +1587,12 @@ static pj_bool_t dataconn_on_data_read(pj_activesock_t *asock,
15871587

15881588
if (size == 0 && status != PJ_SUCCESS) {
15891589
/* Connection gone, release data connection */
1590-
dataconn_cleanup(conn);
1591-
--turn_sock->data_conn_cnt;
1590+
if (conn->state == DATACONN_STATE_CONN_BINDING) {
1591+
// TODO cancel request (and do not cleanup there)
1592+
} else if (conn->state == DATACONN_STATE_READY) {
1593+
dataconn_cleanup(conn);
1594+
--turn_sock->data_conn_cnt;
1595+
}
15921596
pj_grp_lock_release(turn_sock->grp_lock);
15931597
return PJ_FALSE;
15941598
}

0 commit comments

Comments
 (0)