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 593
 					memcpy(msg->new_uri.s, a->val[0].u.string, len);
594 594
 					msg->new_uri.s[len]=0;
595 595
 					msg->new_uri.len=len;
596
+					ruri_mark_new(); /* available for forking */
596 597
 
597 598
 					ret=1;
598 599
 					break;
... ...
@@ -870,6 +872,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
870 870
 				msg->new_uri.s=new_uri;
871 871
 				msg->new_uri.len=crt-new_uri;
872 872
 				msg->parsed_uri_ok=0;
873
+				ruri_mark_new(); /* available for forking */
873 874
 				ret=1;
874 875
 				break;
875 876
 		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))