Browse code

tm: restore xavps & flags after rebuilding message

(cherry picked from commit 7ee642c58991e594f38247ab0751fadd07ce758c)
(cherry picked from commit ad5f0f522f43a69e0f7f930cac5aefc3f21607df)

lazedo authored on 11/08/2021 14:42:24 • Daniel-Constantin Mierla committed on 17/09/2021 07:05:12
Showing 1 changed files
... ...
@@ -300,10 +300,6 @@ static inline int t_run_local_req(
300 300
 	set_route_type( backup_route_type );
301 301
 	p_onsend=0;
302 302
 
303
-	/* restore original environment */
304
-	tm_xdata_swap(new_cell, &backup_xd, 1);
305
-	setsflagsval(sflag_bk);
306
-
307 303
 	if (unlikely(ra_ctx.run_flags&DROP_R_F)) {
308 304
 		LM_DBG("tm:local-request dropped msg. to %.*s\n", 
309 305
 				lreq.dst_uri.len, lreq.dst_uri.s);
... ...
@@ -365,6 +361,10 @@ normal_update:
365 361
 	}
366 362
 
367 363
 clean:
364
+	/* restore original environment */
365
+	tm_xdata_swap(new_cell, &backup_xd, 1);
366
+	setsflagsval(sflag_bk);
367
+
368 368
 	/* clean local msg structure */
369 369
 	if (unlikely(lreq.new_uri.s))
370 370
 	{