summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2014-07-14 04:49:25 +0000
committerNanang Izzuddin <nanang@teluu.com>2014-07-14 04:49:25 +0000
commit716a11c953cb1ab7c521cf4e56add6c6e367bed0 (patch)
tree6db8f67f1008f41185ff830c3e58fe1239a9aa55
parente52c0a1cdf980f6a4da0a3e2553bf12e4bff92f0 (diff)
Misc (re #1751): Fixed possible bad assertion caused by race condition between regc_tsx_callback() and pjsip_regc_send() (thanks John Ryan for the report).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4876 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip-ua/sip_reg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c
index ca907bab..cca2526d 100644
--- a/pjsip/src/pjsip-ua/sip_reg.c
+++ b/pjsip/src/pjsip-ua/sip_reg.c
@@ -1362,7 +1362,12 @@ PJ_DEF(pj_status_t) pjsip_regc_send(pjsip_regc *regc, pjsip_tx_data *tdata)
return PJSIP_EBUSY;
}
- pj_assert(regc->current_op == REGC_IDLE);
+ /* Just regc->has_tsx check above should be enough. This assertion check
+ * may cause problem, e.g: when regc_tsx_callback() invokes callback,
+ * lock is released and 'has_tsx' is set to FALSE and 'current_op' has
+ * not been updated to REGC_IDLE yet.
+ */
+ //pj_assert(regc->current_op == REGC_IDLE);
/* Invalidate message buffer. */
pjsip_tx_data_invalidate_msg(tdata);