Ignore:
Timestamp:
May 15, 2007 10:42:56 AM (17 years ago)
Author:
bennylp
Message:

Fixed several STUN bugs: USERNAME, REALM etc are not allowed in the response, retransmission timer calculation bug, etc.

File:
1 edited

Legend:

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

    r1152 r1275  
    189189            tsx->retransmit_time.msec = tsx->cfg->rto_msec; 
    190190 
    191         } else if (tsx->transmit_count < PJ_STUN_MAX_RETRANSMIT_COUNT-1) { 
     191        } else if (tsx->transmit_count < PJ_STUN_MAX_TRANSMIT_COUNT-1) { 
    192192            unsigned msec; 
    193193 
    194194            msec = PJ_TIME_VAL_MSEC(tsx->retransmit_time); 
    195             msec = (msec << 1) + 100; 
     195            msec <<= 1; 
    196196            tsx->retransmit_time.sec = msec / 1000; 
    197197            tsx->retransmit_time.msec = msec % 1000; 
     
    217217 
    218218 
     219    tsx->transmit_count++; 
     220 
     221    PJ_LOG(5,(tsx->obj_name, "STUN sending message (transmit count=%d)", 
     222              tsx->transmit_count)); 
     223 
    219224    /* Send message */ 
    220225    status = tsx->cb.on_send_msg(tsx, tsx->last_pkt, tsx->last_pkt_size); 
     
    229234    } 
    230235 
    231     tsx->transmit_count++; 
    232  
    233     PJ_LOG(5,(tsx->obj_name, "STUN sending message (transmit count=%d)", 
    234               tsx->transmit_count)); 
    235236    return status; 
    236237} 
     
    269270    PJ_UNUSED_ARG(timer_heap); 
    270271 
    271     if (tsx->transmit_count >= PJ_STUN_MAX_RETRANSMIT_COUNT) { 
     272    if (tsx->transmit_count >= PJ_STUN_MAX_TRANSMIT_COUNT) { 
    272273        /* Retransmission count exceeded. Transaction has failed */ 
    273274        tsx->retransmit_timer.id = 0; 
Note: See TracChangeset for help on using the changeset viewer.