[sr-dev] git:master: modules_k/dialog: Provide in-code documentation for tricky part in

Timo Reimann timo.reimann at 1und1.de
Thu Aug 25 13:21:09 CEST 2011


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

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <timo.reimann at 1und1.de>
Date:   Thu Aug 25 13:19:13 2011 +0200

modules_k/dialog: Provide in-code documentation for tricky part in
dlg_new_dialog().

---

 modules_k/dialog/dlg_handlers.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index c6cd650..60ae3a0 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -886,10 +886,14 @@ finish:
     ref_dlg(dlg, 1);
 
 	if (t) {
+		// transaction exists ==> keep ref counter large enough to
+		// avoid premature cleanup and ensure proper dialog referencing
 	    store_dlg_in_tm( req, t, dlg);
 	}
 	else
 	{
+		// no transaction exists ==> postpone work until we see the
+		// request being forwarded statefully
         if ( d_tmb.register_tmcb( req, NULL, TMCB_REQUEST_FWDED,
                 store_dlg_in_tm_cb, (void*)dlg, NULL)<0 ) {
             LM_ERR("failed to store dialog in transaction during dialog creation for later reference\n");




More information about the sr-dev mailing list