Module: sip-router
Branch: tmp/build_request
Commit: fa699018d34721c79426fa657a68ca46ed0293b7
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fa69901…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Jul 21 12:20:16 2009 +0200
tm: local req. route: do not save/restore the avps
- reset_avps() moved after running the local req. route so at
least there is a chance that some avps could be used (although
it's unclear what non-global avps could have made it so far
so it's probably safer to say that in general no defined avps
should be expected).
- no need to save or restore the avps after running the local req.
route (they are reset anyway).
---
modules/tm/uac.c | 34 ++++++----------------------------
1 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/modules/tm/uac.c b/modules/tm/uac.c
index b1a79fa..9a9e52b 100644
--- a/modules/tm/uac.c
+++ b/modules/tm/uac.c
@@ -210,9 +210,6 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
int buf_len1;
int sflag_bk;
int backup_route_type;
- avp_list_t* backup_user_from, *backup_user_to;
- avp_list_t* backup_domain_from, *backup_domain_to;
- avp_list_t* backup_uri_from, *backup_uri_to;
#endif
ret=-1;
@@ -300,10 +297,6 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
new_cell->rt_t2_timeout=cfg_get(tm, tm_cfg, rt_t2_timeout);
#endif
- /* better reset avp list now - anyhow, it's useless from
- * this point (bogdan) */
- reset_avps();
-
set_kr(REQ_FWDED);
request = &new_cell->uac[0].request;
@@ -349,20 +342,8 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
#ifdef USE_COMP
lreq.rcv.comp=dst.comp;
#endif /* USE_COMP */
- /* backup environment (e.g., AVP lists, ...) */
- backup_uri_from = set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI,
- &new_cell->uri_avps_from);
- backup_uri_to = set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI,
- &new_cell->uri_avps_to);
- backup_user_from = set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER,
- &new_cell->user_avps_from);
- backup_user_to = set_avp_list(AVP_TRACK_TO | AVP_CLASS_USER,
- &new_cell->user_avps_to);
- backup_domain_from = set_avp_list(
- AVP_TRACK_FROM | AVP_CLASS_DOMAIN,
- &new_cell->domain_avps_from);
- backup_domain_to = set_avp_list(AVP_TRACK_TO | AVP_CLASS_DOMAIN,
- &new_cell->domain_avps_to);
+ /* AVPs are reset anyway afterwards, so no need to
+ backup/restore them*/
sflag_bk = getsflags();
/* run the route */
@@ -372,13 +353,6 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
set_route_type( backup_route_type );
/* restore original environment */
- set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, backup_uri_from);
- set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, backup_uri_to);
- 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);
setsflagsval(sflag_bk);
if (unlikely(lreq.new_uri.s))
@@ -414,6 +388,10 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
}
#endif
+ /* better reset avp list now - anyhow, it's useless from
+ * this point (bogdan) */
+ reset_avps();
+
new_cell->method.s = buf;
new_cell->method.len = uac_r->method->len;