Changeset 2361


Ignore:
Timestamp:
Oct 31, 2008 5:54:14 PM (16 years ago)
Author:
bennylp
Message:

Ticket #673: rollback r2360, and implement new fix for Race condition may cause crash in SRTP transport ticket

File:
1 edited

Legend:

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

    r2360 r2361  
    647647    pj_status_t status; 
    648648 
    649     /* Attach itself to transport */ 
    650     status = pjmedia_transport_attach(srtp->member_tp, srtp, rem_addr, rem_rtcp, 
    651                                       addr_len, &srtp_rtp_cb, &srtp_rtcp_cb); 
    652     if (status != PJ_SUCCESS) 
    653         return status; 
    654  
    655649    /* Save the callbacks */ 
    656650    srtp->rtp_cb = rtp_cb; 
     
    658652    srtp->user_data = user_data; 
    659653 
    660     return status; 
     654    /* Attach itself to transport */ 
     655    status = pjmedia_transport_attach(srtp->member_tp, srtp, rem_addr,  
     656                                      rem_rtcp, addr_len, &srtp_rtp_cb, 
     657                                      &srtp_rtcp_cb); 
     658    if (status != PJ_SUCCESS) { 
     659        srtp->rtp_cb = NULL; 
     660        srtp->rtcp_cb = NULL; 
     661        srtp->user_data = NULL; 
     662        return status; 
     663    } 
     664 
     665    return PJ_SUCCESS; 
    661666} 
    662667 
     
    799804 
    800805    if (srtp->bypass_srtp) { 
    801         /* Callback may be NULL if we receive stray packets (or when packet 
    802          * is received while we're being detached/re-attached). 
    803          */ 
    804         if (srtp->rtp_cb) { 
    805             srtp->rtp_cb(srtp->user_data, pkt, size); 
    806         } 
     806        srtp->rtp_cb(srtp->user_data, pkt, size); 
    807807        return; 
    808808    } 
     
    864864 
    865865    if (srtp->bypass_srtp) { 
    866         /* Callback may be NULL if we receive stray packets (or when packet 
    867          * is received while we're being detached/re-attached). 
    868          */ 
    869866        srtp->rtcp_cb(srtp->user_data, pkt, size); 
    870867        return; 
Note: See TracChangeset for help on using the changeset viewer.