[sr-dev] git:tmp/tm_async_reply_support: modules/tm: no need to restore after faked environment for async TM

Jason Penton jason.penton at gmail.com
Wed Jul 10 14:41:18 CEST 2013


Module: sip-router
Branch: tmp/tm_async_reply_support
Commit: 33c943b339955dc21c672de1e8fc35bd45fee07c
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=33c943b339955dc21c672de1e8fc35bd45fee07c

Author: Jason Penton <jason.penton at smilecoms.com>
Committer: Jason Penton <jason.penton at smilecoms.com>
Date:   Wed Jul 10 14:40:22 2013 +0200

modules/tm: no need to restore after faked environment for async TM

---

 modules/tm/t_reply.c   |   22 +++-------------------
 modules/tm/t_suspend.c |    2 +-
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index d6f6030..4ab4532 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -1019,25 +1019,9 @@ void faked_env_async( struct cell *t, struct sip_msg *msg) {
 		backup_body_lumps = t->uas.request->body_lumps;
 		backup_reply_lump = t->uas.request->reply_lump;
 	} else {
-		/* restore original environment */
-		set_t(backup_t, backup_branch);
-		global_msg_id=backup_msgid;
-		set_route_type(backup_route_type);
-		/* restore original avp list */
-		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER, backup_user_from );
-		set_avp_list(AVP_TRACK_TO | AVP_CLASS_USER, backup_user_to );
-		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_DOMAIN, backup_domain_from );
-		set_avp_list(AVP_TRACK_TO | AVP_CLASS_DOMAIN, backup_domain_to );
-		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, backup_uri_from );
-		set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, backup_uri_to );
-#ifdef WITH_XAVP
-		xavp_set_list(backup_xavps);
-#endif
-		bind_address=backup_si;
-		/* restore lump lists */
-		t->uas.request->add_rm = backup_add_rm;
-		t->uas.request->body_lumps = backup_body_lumps;
-		t->uas.request->reply_lump = backup_reply_lump;
+		/* on async restore - we don't need to do anything because we never really had 
+                   an environment to restore prior to the suspend anyway ;) */
+            LM_DBG("nothing to restore for async...\n");
 	}
 }
 
diff --git a/modules/tm/t_suspend.c b/modules/tm/t_suspend.c
index b9806a0..adc8faa 100644
--- a/modules/tm/t_suspend.c
+++ b/modules/tm/t_suspend.c
@@ -277,7 +277,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
 	/* TODO: save_msg_lumps should clone the lumps to shm mem */
 
 	/* restore original environment and free the fake msg */
-	faked_env( t, 0);
+	faked_env_async( t, 0);
 	free_faked_req(&faked_req, t);
 
 	/* update the flags */




More information about the sr-dev mailing list