Module: sip-router
Branch: 3.1
Commit: 4ade7f79a50d017a9ef3562691b2a7d5a936b20d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4ade7f7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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
(cherry picked from commit b6d90904de590a3f6a95bca8f89cf2521d630902)
(cherry picked from commit 6fd2307f66d7207721e6a346d6287a3b9c043107)
---
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 ec11948..c324502 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -756,6 +756,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;
@@ -795,6 +800,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);
@@ -811,6 +820,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;
}
}