Ignore:
Timestamp:
Apr 4, 2006 11:06:34 AM (18 years ago)
Author:
bennylp
Message:

Changed pjsip_dlg_send_request() API to NOT return transaction as it is not safe against race condition

File:
1 edited

Legend:

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

    r315 r376  
    932932PJ_DEF(pj_status_t) pjsip_dlg_send_request( pjsip_dialog *dlg, 
    933933                                            pjsip_tx_data *tdata, 
    934                                             pjsip_transaction **p_tsx ) 
     934                                            int mod_data_id, 
     935                                            void *mod_data) 
    935936{ 
    936937    pjsip_transaction *tsx; 
     
    979980        tsx->mod_data[dlg->ua->id] = dlg; 
    980981 
     982        /* Copy optional caller's mod_data, if present */ 
     983        if (mod_data_id >= 0 && mod_data_id < PJSIP_MAX_MODULE) 
     984            tsx->mod_data[mod_data_id] = mod_data; 
     985 
    981986        /* Increment transaction counter. */ 
    982987        ++dlg->tsx_count; 
     
    989994        } 
    990995 
    991         if (p_tsx) 
    992             *p_tsx = tsx; 
    993  
    994996    } else { 
    995997        status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata,  
     
    9981000            goto on_error; 
    9991001 
    1000         if (p_tsx) 
    1001             *p_tsx = NULL; 
    10021002    } 
    10031003 
     
    10141014    pjsip_tx_data_dec_ref( tdata ); 
    10151015 
    1016     if (p_tsx) 
    1017         *p_tsx = NULL; 
    10181016    return status; 
    10191017} 
Note: See TracChangeset for help on using the changeset viewer.