[Asterisk-code-review] res pjsip: Handle invocation of callback on outgoing request... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Feb 1 11:34:55 CST 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/4846 )

Change subject: res_pjsip: Handle invocation of callback on outgoing request when error occurs.
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/4846/2/res/res_pjsip.c
File res/res_pjsip.c:

PS2, Line 3602: 	ret_val = pjsip_endpt_send_request(endpt, tdata, -1, req_wrapper, endpt_send_request_cb);
              : 	if (req_wrapper->cb_called) {
Just checking cb_called on a successful return is a race condition.  We should check the flag after checking the return status.


Line 3654: 		}
} else if (!req_wrapper->cb_called) {
  ao2_ref(req_wrapper, -1);
} else {
   /* Callback was called so cannot return failure */
   ret_val = PJ_SUCCESS;
}


-- 
To view, visit https://gerrit.asterisk.org/4846
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I563982ba204da5aa1428989a11c06dd9087fea91
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list