summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-19 01:37:35 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-19 01:37:35 +0000
commit4e0f563feccb847c57739e48c91b0f5190938e9d (patch)
treeac26a241075ecee42dbf7142a5ea3ca3896d90d4 /pjsip/include
parentd0a140b588b68d113e5444e711b44e3775b14faa (diff)
Fixed premature dialog deletion, causing crash
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@196 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsip/sip_dialog.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/pjsip/include/pjsip/sip_dialog.h b/pjsip/include/pjsip/sip_dialog.h
index 38f01c79..6a0441fc 100644
--- a/pjsip/include/pjsip/sip_dialog.h
+++ b/pjsip/include/pjsip/sip_dialog.h
@@ -207,30 +207,29 @@ PJ_DECL(pj_status_t) pjsip_dlg_add_usage( pjsip_dialog *dlg,
* Attach module specific data to the dialog. Application can also set
* the value directly by accessing dlg->mod_data[module_id].
*/
-PJ_INLINE(pj_status_t) pjsip_dlg_set_mod_data( pjsip_dialog *dlg,
- int mod_id,
- void *data )
-{
- PJ_ASSERT_RETURN(dlg, PJ_EINVAL);
- PJ_ASSERT_RETURN(mod_id >= 0 && mod_id < PJSIP_MAX_MODULE,
- PJ_EINVAL);
- dlg->mod_data[mod_id] = data;
- return PJ_SUCCESS;
-}
+PJ_DECL(pj_status_t) pjsip_dlg_set_mod_data( pjsip_dialog *dlg,
+ int mod_id,
+ void *data );
/**
* Get module specific data previously attached to the dialog. Application
* can also get value directly by accessing dlg->mod_data[module_id].
*/
-PJ_INLINE(void*) pjsip_dlg_get_mod_data(pjsip_dialog *dlg,
- int mod_id)
-{
- PJ_ASSERT_RETURN(dlg, NULL);
- PJ_ASSERT_RETURN(mod_id >= 0 && mod_id < PJSIP_MAX_MODULE,
- NULL);
- return dlg->mod_data[mod_id];
-}
+PJ_DECL(void*) pjsip_dlg_get_mod_data( pjsip_dialog *dlg,
+ int mod_id);
+
+
+/**
+ * Lock dialog and increment session counter termporarily, to prevent it
+ * from being destroyed.
+ */
+PJ_DECL(void) pjsip_dlg_inc_lock( pjsip_dialog *dlg );
+/**
+ * Unlock dialog and decrement temporary session counter. After this function
+ * is called, dialog may be destroyed.
+ */
+PJ_DECL(void) pjsip_dlg_dec_lock( pjsip_dialog *dlg );
/**