[Asterisk-code-review] res pjsip.c: Rework endpt send request() req wrapper code. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Nov 11 13:00:14 CST 2016


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

Change subject: res_pjsip.c: Rework endpt_send_request() req_wrapper code.
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/4387/1/res/res_pjsip.c
File res/res_pjsip.c:

Line 3541
> This is necessary.  Just calling init doesn't put the timer in the correct 
The pjproject timer code has not changed since the initial required pjproject version.  All this call does here is set the req_wrapper->timeout_timer->id = TIMER_INACTIVE which we then have to set back to TIMEOUT_TIMER2 after we schedule the timer.

It is the endpt_send_request_cb() and send_request_timer_callback() that care about the req_wrapper->timeout_timer->id value.  At this point, the endpt_send_request_cb() can never happen because we haven't even given the request to pjproject to send.  send_request_timer_callback() cannot happen until we have successfully scheduled the timer and would be blocked until we set the req_wrapper->timeout_timer->id value back to TIMEOUT_TIMER2 and release the lock.

This patch rearranges things so holding the lock is not necessary when scheduling the timer.

I think I'm to blame for the sillyness of canceling a timer that we just created and initialized because of a conversation we had on IRC.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3195e3a8e0207bb8e7f49060ad2742cf21a6e4c9
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list