Changeset 5380 for pjproject


Ignore:
Timestamp:
Jul 13, 2016 9:57:26 AM (8 years ago)
Author:
nanang
Message:

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?).
Location:
pjproject/trunk/pjnath/src/pjnath
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/turn_session.c

    r5349 r5380  
    785785         * let the application do it if it wants to. 
    786786         */ 
    787         set_state(sess, PJ_TURN_STATE_RESOLVED); 
     787        /* Set state back to RESOLVED may cause infinite loop (see #1942). */ 
     788        //set_state(sess, PJ_TURN_STATE_RESOLVED); 
    788789    } 
    789790 
     
    17501751    /* Run pending allocation */ 
    17511752    if (sess->pending_alloc) { 
    1752         pj_turn_session_alloc(sess, NULL); 
     1753        pj_status_t status; 
     1754        status = pj_turn_session_alloc(sess, NULL); 
     1755        if (status != PJ_SUCCESS) 
     1756            on_session_fail(sess, PJ_STUN_ALLOCATE_METHOD, status, NULL); 
    17531757    } 
    17541758} 
  • pjproject/trunk/pjnath/src/pjnath/turn_sock.c

    r5375 r5380  
    735735    if (turn_sock == NULL) { 
    736736        /* We've been destroyed */ 
    737         return; 
    738     } 
    739  
    740     if (old_state == PJ_TURN_STATE_ALLOCATING && 
    741         new_state == PJ_TURN_STATE_RESOLVED) 
    742     { 
    743         /* TURN session won't destroy itself upon allocation failure, it will 
    744          * just revert back TURN state to PJ_TURN_STATE_RESOLVED. So, let's 
    745          * avoid infinite loop here (see ticket #1942). 
    746          */ 
    747737        return; 
    748738    } 
Note: See TracChangeset for help on using the changeset viewer.