Ignore:
Timestamp:
Aug 1, 2018 9:22:26 AM (6 years ago)
Author:
riza
Message:

Fixed #2137: Race condition in 183 re-transmission can result in a deadlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r5812 r5851  
    23832383{ 
    23842384    pjsip_tx_data *last_res; 
     2385    pjsip_tx_data *old_res; 
    23852386    pj_status_t status; 
    23862387 
     
    23982399    pjsip_dlg_inc_lock(inv->dlg); 
    23992400 
     2401    /* Clone last response. 
     2402     * The tdata (last_answer) is a shared object used by the transaction. 
     2403     * Modifying a shared object might lead to a deadlock. 
     2404     * Refer to ticket #2137 for more detail. 
     2405     */ 
     2406    status = pjsip_tx_data_clone(inv->last_answer, 0, &last_res); 
     2407    if (status != PJ_SUCCESS) 
     2408        goto on_return; 
     2409    old_res = inv->last_answer; 
     2410    inv->last_answer = last_res; 
     2411    pjsip_tx_data_dec_ref(old_res); 
     2412 
    24002413    /* Modify last response. */ 
    2401     last_res = inv->last_answer; 
    24022414    status = pjsip_dlg_modify_response(inv->dlg, last_res, st_code, st_text); 
    24032415    if (status != PJ_SUCCESS) 
Note: See TracChangeset for help on using the changeset viewer.