[sr-dev] git:master: tm: backup/restore lump lists for faked requests

Daniel-Constantin Mierla miconda at gmail.com
Thu Nov 24 15:33:36 CET 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Nov 24 15:28:04 2011 +0100

tm: backup/restore lump lists for faked requests

- some cfg functions that can be used in failure_route can destroy the
  head of lump lists, thus better backup before and restore after failure_route
  execution

---

 modules/tm/t_reply.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index b7c3a84..90ffa73 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -764,6 +764,11 @@ void faked_env( struct cell *t, struct sip_msg *msg)
 #endif
 	static struct socket_info* backup_si;
 
+	static struct lump *backup_add_rm;
+	static struct lump *backup_body_lumps;
+	static struct lump_rpl *backup_reply_lump;
+
+
 	if (msg) {
 		/* remember we are back in request processing, but process
 		 * a shmem-ed replica of the request; advertise it in route type;
@@ -803,6 +808,10 @@ void faked_env( struct cell *t, struct sip_msg *msg)
 		/* set default send address to the saved value */
 		backup_si=bind_address;
 		bind_address=t->uac[0].request.dst.send_sock;
+		/* backup lump lists */
+		backup_add_rm = t->uas.request->add_rm;
+		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);
@@ -819,6 +828,10 @@ void faked_env( struct cell *t, struct sip_msg *msg)
 		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;
 	}
 }
 




More information about the sr-dev mailing list