Module: sip-router
Branch: master
Commit: ac2e49b41840e0b05750b20c367a6c380caa983a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ac2e49b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Apr 18 10:49:24 2014 +0200
tm: lock replies before restoring flags for onreply_route
---
modules/tm/t_reply.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 7fb66b8..2070d9d 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -2336,6 +2336,11 @@ int reply_received( struct sip_msg *p_msg )
/* processing of on_reply block */
if (onreply_route) {
set_route_type(TM_ONREPLY_ROUTE);
+
+ /* lock onreply_route, for safe avp usage */
+ LOCK_REPLIES( t );
+ replies_locked=1;
+
/* transfer transaction flag to message context */
if (t->uas.request) p_msg->flags=t->uas.request->flags;
/* set the as avp_list the one from transaction */
@@ -2353,9 +2358,6 @@ int reply_received( struct sip_msg *p_msg )
/* Pre- and post-script callbacks have already
* been executed by the core. (Miklos)
*/
- /* lock onreply_route, for safe avp usage */
- LOCK_REPLIES( t );
- replies_locked=1;
run_top_route(onreply_rt.rlist[onreply_route], p_msg, &ctx);
/* transfer current message context back to t */
if (t->uas.request) t->uas.request->flags=p_msg->flags;