diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2016-07-13 09:57:26 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2016-07-13 09:57:26 +0000 |
commit | 5fb0f734da0840c49bc2ec2e11b2d2b3b6e096b4 (patch) | |
tree | 3c91b2b8ee6e71878cdfc9240e9f9a6e69311758 /pjnath/src/pjnath/turn_session.c | |
parent | b81a9275705ad5c3d3ab202061039d6f42ad2ffa (diff) |
Re #1942:
- Reverted back r5375, otherwise retrying next server will not work as it is using the ALLOCATING -> RESOLVED.
- Don't set state to RESOLVED when pj_stun_session_send_msg() fails to avoid infinite loop, simply return the error code and let application destroy the TURN client session (which is already done by TURN socket).
- Handle allocation error when delayed allocation fails (otherwise TURN client session may never get destroyed?).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5380 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/src/pjnath/turn_session.c')
-rw-r--r-- | pjnath/src/pjnath/turn_session.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pjnath/src/pjnath/turn_session.c b/pjnath/src/pjnath/turn_session.c index 6e933d42..8a530021 100644 --- a/pjnath/src/pjnath/turn_session.c +++ b/pjnath/src/pjnath/turn_session.c @@ -784,7 +784,8 @@ PJ_DEF(pj_status_t) pj_turn_session_alloc(pj_turn_session *sess, /* Set state back to RESOLVED. We don't want to destroy session now, * let the application do it if it wants to. */ - set_state(sess, PJ_TURN_STATE_RESOLVED); + /* Set state back to RESOLVED may cause infinite loop (see #1942). */ + //set_state(sess, PJ_TURN_STATE_RESOLVED); } pj_grp_lock_release(sess->grp_lock); @@ -1749,7 +1750,10 @@ static void dns_srv_resolver_cb(void *user_data, /* Run pending allocation */ if (sess->pending_alloc) { - pj_turn_session_alloc(sess, NULL); + pj_status_t status; + status = pj_turn_session_alloc(sess, NULL); + if (status != PJ_SUCCESS) + on_session_fail(sess, PJ_STUN_ALLOCATE_METHOD, status, NULL); } } |