Browse code

tm: update T msg flags after {branch/failure}_route

- after execution of branch_route or failure_route, set the message
flags of the temporary request back to transaction request
- 1.x behaviour
- reported and partial patch by Alex Hermann

Daniel-Constantin Mierla authored on 06/09/2011 12:12:00
Showing 2 changed files
... ...
@@ -1511,6 +1511,9 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg ,
1511 1511
 
1512 1512
 	setbflagsval(0, backup_bflags);
1513 1513
 
1514
+	/* update message flags, if changed in branch route */
1515
+	t->uas.request->flags = p_msg->flags;
1516
+
1514 1517
 	/* don't forget to clear all branches processed so far */
1515 1518
 
1516 1519
 	/* things went wrong ... no new branch has been fwd-ed at all */
... ...
@@ -968,11 +968,13 @@ int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
968 968
 		on_failure = t->on_negative;
969 969
 		t->on_negative=0;
970 970
 		if (exec_pre_script_cb(&faked_req, FAILURE_CB_TYPE)>0) {
971
-			/* run a reply_route action if some was marked */
971
+			/* run a failure_route action if some was marked */
972 972
 			if (run_top_route(failure_rt.rlist[on_failure], &faked_req, 0)<0)
973 973
 				LOG(L_ERR, "ERROR: run_failure_handlers: Error in run_top_route\n");
974 974
 			exec_post_script_cb(&faked_req, FAILURE_CB_TYPE);
975 975
 		}
976
+		/* update message flags, if changed in failure route */
977
+		t->uas.request->flags = faked_req.flags;
976 978
 	}
977 979
 
978 980
 	/* restore original environment and free the fake msg */