Ignore:
Timestamp:
Feb 27, 2013 3:02:03 PM (11 years ago)
Author:
riza
Message:

Re #1620: backported to 1.x

Location:
pjproject/branches/1.x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x

  • pjproject/branches/1.x/pjnath/src/pjnath/stun_transaction.c

    r3553 r4407  
    181181 * Transmit message. 
    182182 */ 
    183 static pj_status_t tsx_transmit_msg(pj_stun_client_tsx *tsx) 
     183static pj_status_t tsx_transmit_msg(pj_stun_client_tsx *tsx, 
     184                                    pj_bool_t mod_count) 
    184185{ 
    185186    pj_status_t status; 
     
    188189                     !tsx->require_retransmit, PJ_EBUSY); 
    189190 
    190     if (tsx->require_retransmit) { 
     191    if (tsx->require_retransmit && mod_count) { 
    191192        /* Calculate retransmit/timeout delay */ 
    192193        if (tsx->transmit_count == 0) { 
     
    222223 
    223224 
    224     tsx->transmit_count++; 
     225    if (mod_count) 
     226        tsx->transmit_count++; 
    225227 
    226228    PJ_LOG(5,(tsx->obj_name, "STUN sending message (transmit count=%d)", 
     
    233235        /* We've been destroyed, don't access the object. */ 
    234236    } else if (status != PJ_SUCCESS) { 
    235         if (tsx->retransmit_timer.id != 0) { 
     237        if (tsx->retransmit_timer.id != 0 && mod_count) { 
    236238            pj_timer_heap_cancel(tsx->timer_heap,  
    237239                                 &tsx->retransmit_timer); 
     
    295297 
    296298    /* Send the message */ 
    297     status = tsx_transmit_msg(tsx); 
     299    status = tsx_transmit_msg(tsx, PJ_TRUE); 
    298300    if (status != PJ_SUCCESS) { 
    299301        if (tsx->retransmit_timer.id != 0) { 
     
    333335 
    334336    tsx->retransmit_timer.id = 0; 
    335     status = tsx_transmit_msg(tsx); 
     337    status = tsx_transmit_msg(tsx, PJ_TRUE); 
    336338    if (status == PJNATH_ESTUNDESTROYED) { 
    337339        /* We've been destroyed, don't try to access the object */ 
     
    351353 * Request to retransmit the request. 
    352354 */ 
    353 PJ_DEF(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx) 
     355PJ_DEF(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx, 
     356                                                  pj_bool_t mod_count) 
    354357{ 
    355358    if (tsx->destroy_timer.id != 0) { 
     
    362365    } 
    363366 
    364     return tsx_transmit_msg(tsx); 
     367    return tsx_transmit_msg(tsx, mod_count); 
    365368} 
    366369 
Note: See TracChangeset for help on using the changeset viewer.