mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Fix race condition where duplicated requests may be handled by multiple threads.
This is the Asterisk 13 version of the patch. The main difference is in the pubsub code since it was completely refactored between Asterisk 12 and 13. Review: https://reviewboard.asterisk.org/r/4175 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1416,6 +1416,7 @@ static pjsip_inv_session *pre_session_setup(pjsip_rx_data *rdata, const struct a
|
||||
pjsip_dialog *dlg;
|
||||
pjsip_inv_session *inv_session;
|
||||
unsigned int options = endpoint->extensions.flags;
|
||||
pj_status_t dlg_status;
|
||||
|
||||
if (pjsip_inv_verify_request(rdata, &options, NULL, NULL, ast_sip_get_pjsip_endpoint(), &tdata) != PJ_SUCCESS) {
|
||||
if (tdata) {
|
||||
@@ -1425,9 +1426,11 @@ static pjsip_inv_session *pre_session_setup(pjsip_rx_data *rdata, const struct a
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
dlg = ast_sip_create_dialog_uas(endpoint, rdata);
|
||||
dlg = ast_sip_create_dialog_uas(endpoint, rdata, &dlg_status);
|
||||
if (!dlg) {
|
||||
pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 500, NULL, NULL, NULL);
|
||||
if (dlg_status != PJ_EEXISTS) {
|
||||
pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 500, NULL, NULL, NULL);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (pjsip_inv_create_uas(dlg, rdata, NULL, options, &inv_session) != PJ_SUCCESS) {
|
||||
|
Reference in New Issue
Block a user