[sr-dev] git:master: dialog: simplified dlg referencing on creation and spiral detection

Daniel-Constantin Mierla miconda at gmail.com
Thu Aug 14 17:52:26 CEST 2014


Module: sip-router
Branch: master
Commit: fcf5f5b3115c0c40f4df9eb066489bb3e590c3b1
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fcf5f5b3115c0c40f4df9eb066489bb3e590c3b1

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Aug 14 14:46:21 2014 +0200

dialog: simplified dlg referencing on creation and spiral detection

---

 modules/dialog/dlg_handlers.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index d271bf0..947bd5b 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -818,8 +818,8 @@ int dlg_new_dialog(sip_msg_t *req, struct cell *t, const int run_initial_cbs)
 				if (run_initial_cbs)
 					run_dlg_callbacks( DLGCB_SPIRALED, dlg, req, NULL,
 							DLG_DIR_DOWNSTREAM, 0);
-				/* get_dlg() has incremented the ref count by 1
-				 * - it's ok, dlg will be unref at the end of function */
+				/* get_dlg() has incremented the ref count by 1 */
+				dlg_release(dlg);
 				goto finish;
 			}
 			dlg_release(dlg);
@@ -872,16 +872,12 @@ int dlg_new_dialog(sip_msg_t *req, struct cell *t, const int run_initial_cbs)
 		goto error;
 	}
 
-	/* new dlg - reference it once more for current dialog iuid shortcut */
-    dlg_ref(dlg, 1);
-
     if_update_stat( dlg_enable_stats, processed_dlgs, 1);
 
 finish:
     _dlg_ctx.iuid.h_entry = dlg->h_entry;
     _dlg_ctx.iuid.h_id = dlg->h_id;
     set_current_dialog(req, dlg);
-	dlg_release(dlg);
 
 	return 0;
 




More information about the sr-dev mailing list