Browse code

core: mark uri as new on new message or seturi()

Each time a new message is received the r-uri is marked as "new"
(available for forking). The same happens when the uri is changed
or modified in the script (seturi(), rewrite_uri(), setuser(),
sethost() a.s.o.).

Andrei Pelinescu-Onciul authored on 27/05/2010 08:55:18
Showing 2 changed files
... ...
@@ -545,6 +545,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
545 545
 				msg->new_uri.len=0;
546 546
 				msg->new_uri.s=0;
547 547
 				msg->parsed_uri_ok=0; /* invalidate current parsed uri*/
548
+				ruri_mark_new(); /* available for forking */
548 549
 			};
549 550
 			ret=1;
550 551
 			break;
... ...
@@ -593,6 +594,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
593 594
 					memcpy(msg->new_uri.s, a->val[0].u.string, len);
594 595
 					msg->new_uri.s[len]=0;
595 596
 					msg->new_uri.len=len;
597
+					ruri_mark_new(); /* available for forking */
596 598
 
597 599
 					ret=1;
598 600
 					break;
... ...
@@ -870,6 +872,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
870 872
 				msg->new_uri.s=new_uri;
871 873
 				msg->new_uri.len=crt-new_uri;
872 874
 				msg->parsed_uri_ok=0;
875
+				ruri_mark_new(); /* available for forking */
873 876
 				ret=1;
874 877
 				break;
875 878
 		case IF_T:
... ...
@@ -149,6 +149,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
149 149
 	clear_branches();
150 150
 
151 151
 	if (msg->first_line.type==SIP_REQUEST){
152
+		ruri_mark_new(); /* ruri is usable for forking (not consumed yet) */
152 153
 		if (!IS_SIP(msg)){
153 154
 			if ((ret=nonsip_msg_run_hooks(msg))!=NONSIP_MSG_ACCEPT){
154 155
 				if (unlikely(ret==NONSIP_MSG_ERROR))