Changeset 5783 for pjproject


Ignore:
Timestamp:
Apr 18, 2018 7:45:46 AM (7 years ago)
Author:
nanang
Message:

Re #2096: Start UDP transport earlier to allow early DTLS-SRTP nego.

Location:
pjproject/trunk/pjmedia/src/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c

    r5782 r5783  
    595595 
    596596 
     597/* Start socket if member transport is UDP */ 
     598static pj_status_t udp_member_transport_media_start(dtls_srtp *ds) 
     599{ 
     600    pjmedia_transport_info info; 
     601    pj_status_t status; 
     602 
     603    if (!ds->srtp->member_tp) 
     604        return PJ_SUCCESS; 
     605 
     606    pjmedia_transport_info_init(&info); 
     607    status = pjmedia_transport_get_info(ds->srtp->member_tp, &info); 
     608    if (status != PJ_SUCCESS) 
     609        return status; 
     610 
     611    if (info.specific_info_cnt == 1 && 
     612        info.spc_info[0].type == PJMEDIA_TRANSPORT_TYPE_UDP) 
     613    { 
     614        return pjmedia_transport_media_start(ds->srtp->member_tp, 0, 0, 0, 0); 
     615    } 
     616 
     617    return PJ_SUCCESS; 
     618} 
     619 
     620 
    597621/* Flush write BIO */ 
    598622static pj_status_t ssl_flush_wbio(dtls_srtp *ds) 
     
    11831207        if (status != PJ_SUCCESS) 
    11841208            goto on_return; 
     1209 
     1210        /* Start member transport if it is UDP, so we can receive packet 
     1211         * (see also #2097). 
     1212         */ 
     1213        udp_member_transport_media_start(ds); 
    11851214    } 
    11861215 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c

    r5769 r5783  
    672672    info->src_rtcp_name = udp->rtcp_src_addr; 
    673673 
     674    /* Add empty specific info */ 
     675    if (info->specific_info_cnt < PJ_ARRAY_SIZE(info->spc_info)) { 
     676        pjmedia_transport_specific_info *tsi; 
     677 
     678        tsi = &info->spc_info[info->specific_info_cnt++]; 
     679        tsi->type = PJMEDIA_TRANSPORT_TYPE_UDP; 
     680        tsi->cbsize = 0; 
     681    } 
     682 
    674683    return PJ_SUCCESS; 
    675684} 
Note: See TracChangeset for help on using the changeset viewer.