Changeset 3832


Ignore:
Timestamp:
Oct 20, 2011 4:01:26 AM (8 years ago)
Author:
bennylp
Message:

Fixed #1319: When sips scheme is used, TLS must be used even when transport=tcp is specified in the URI (thanks Iñaki Baz Castillo for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsip/sip_util.c

    r3813 r3832  
    814814        pjsip_uri *uri = (pjsip_uri*) target_uri; 
    815815        const pjsip_sip_uri *url=(const pjsip_sip_uri*)pjsip_uri_get_uri(uri); 
     816        unsigned flag; 
     817 
    816818        dest_info->flag |= (PJSIP_TRANSPORT_SECURE | PJSIP_TRANSPORT_RELIABLE); 
    817819        if (url->maddr_param.slen) 
     
    822824        dest_info->type =  
    823825            pjsip_transport_get_type_from_name(&url->transport_param); 
     826        /* Double-check that the transport parameter match. 
     827         * Sample case:     sips:host;transport=tcp 
     828         * See https://trac.pjsip.org/repos/ticket/1319 
     829         */ 
     830        flag = pjsip_transport_get_flag_from_type(dest_info->type); 
     831        if ((flag & dest_info->flag) != dest_info->flag) { 
     832            pjsip_transport_type_e t; 
     833 
     834            t = pjsip_transport_get_type_from_flag(dest_info->flag); 
     835            if (t != PJSIP_TRANSPORT_UNSPECIFIED) 
     836                dest_info->type = t; 
     837        } 
    824838 
    825839    } else if (PJSIP_URI_SCHEME_IS_SIP(target_uri)) { 
Note: See TracChangeset for help on using the changeset viewer.