瀏覽代碼

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

Timo Reimann 14 年之前
父節點
當前提交
d903b7707d
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      modules_k/dialog/dlg_handlers.c

+ 4 - 0
modules_k/dialog/dlg_handlers.c

@@ -886,10 +886,14 @@ finish:
     ref_dlg(dlg, 1);
     ref_dlg(dlg, 1);
 
 
 	if (t) {
 	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);
 	    store_dlg_in_tm( req, t, dlg);
 	}
 	}
 	else
 	else
 	{
 	{
+		// no transaction exists ==> postpone work until we see the
+		// request being forwarded statefully
         if ( d_tmb.register_tmcb( req, NULL, TMCB_REQUEST_FWDED,
         if ( d_tmb.register_tmcb( req, NULL, TMCB_REQUEST_FWDED,
                 store_dlg_in_tm_cb, (void*)dlg, NULL)<0 ) {
                 store_dlg_in_tm_cb, (void*)dlg, NULL)<0 ) {
             LM_ERR("failed to store dialog in transaction during dialog creation for later reference\n");
             LM_ERR("failed to store dialog in transaction during dialog creation for later reference\n");