Changeset 1555 for pjproject/trunk


Ignore:
Timestamp:
Nov 6, 2007 8:59:17 AM (17 years ago)
Author:
bennylp
Message:

Fixed bug in route set calculation: prevent updating route set upon receiving failure response (e.g. 401/407 response), and remove the first_cseq check since this would not work when the first request is challenged

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r1550 r1555  
    15611561            return; 
    15621562 
    1563         /* Ignore subsequent responses with higher CSeq than initial CSeq */ 
    1564         if (msg_cseq != dlg->local.first_cseq) 
    1565             return; 
     1563        /* Ignore subsequent responses with higher CSeq than initial CSeq. 
     1564         * Unfortunately this would be broken when the first request is  
     1565         * challenged! 
     1566         */ 
     1567        //if (msg_cseq != dlg->local.first_cseq) 
     1568        //    return; 
    15661569 
    15671570    } else { 
     
    15771580    /* Based on the checks above, we should only get response message here */ 
    15781581    pj_assert(msg->type == PJSIP_RESPONSE_MSG); 
     1582 
     1583    /* Ignore if this is not 1xx or 2xx response */ 
     1584    if (msg->line.status.code >= 300) 
     1585        return; 
    15791586 
    15801587    /* Reset route set */ 
     
    15921599    } 
    15931600 
     1601    PJ_LOG(5,(dlg->obj_name, "Route-set updated")); 
     1602 
    15941603    /* Freeze the route set only when the route set comes in 2xx response.  
    15951604     * If it is in 1xx response, prepare to recompute the route set when  
     
    16001609     * it is safer to not freeze the route set (thus recompute the route set 
    16011610     * upon receiving 2xx response). Also RFC 3261 says so in 13.2.2.4. 
    1602      */ 
    1603     if (PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200)) { 
     1611     * 
     1612     * The pjsip_method_creates_dialog() check protects from wrongly  
     1613     * freezing the route set upon receiving 200/OK response for PRACK. 
     1614     */ 
     1615    if (pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) && 
     1616        PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200))  
     1617    { 
    16041618        dlg->route_set_frozen = PJ_TRUE; 
     1619        PJ_LOG(5,(dlg->obj_name, "Route-set frozen")); 
    16051620    } 
    16061621} 
Note: See TracChangeset for help on using the changeset viewer.