]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_pubsub: Ensure dialog lock balance. 11/1511/1
authorMark Michelson <mmichelson@digium.com>
Tue, 29 Sep 2015 19:53:22 +0000 (14:53 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 22 Oct 2015 21:19:10 +0000 (16:19 -0500)
commitbda0a24206a56219f7738f3abbb45c6801746832
treea23ef0870af2a34cc2852c31b30d027ed4f85926
parent7a22fc27fbf85ca27869f9e103f517de527d84f4
res_pjsip_pubsub: Ensure dialog lock balance.

When sending a NOTIFY, we lock the dialog and then unlock the dialog
when finished. A recent change made it so that the subscription tree's
dialog pointer will be set NULL when sending the final NOTIFY request
out. This means that when we attempt to unlock the dialog, we pass a
NULL pointer to pjsip_dlg_dec_lock(). The result is that the dialog
remains locked after we think we have unlocked it. When a response to
the NOTIFY arrives, the monitor thread attempts to lock the dialog, but
it cannot because we never released the dialog lock. This results in
Asterisk being unable to process incoming SIP traffic any longer.

The fix in this patch is to use a local pointer to save off the pointer
value of the subscription tree's dialog when locking and unlocking the
dialog. This way, if the subscription tree's dialog pointer is NULLed
out, the local pointer will still have point to the proper place and the
dialog lock will be unlocked as we expect.

Change-Id: I7ddb3eaed7276cceb9a65daca701c3d5e728e63a
res/res_pjsip_pubsub.c