Browse code

on_negative_reply faked msg now copied from shmem msg (as opposed to zero-ing) -- more "read-only" actions (exec in particular) will work from reply_route; caution, rw actions may append some pkg stuff to msg, which will possibly be never released (shmem is released in a single block)

Jiri Kuthan authored on 06/01/2003 03:04:47
Showing 1 changed files
... ...
@@ -870,10 +870,22 @@ void on_negative_reply( struct cell* t, struct sip_msg* msg,
870 870
 	/* create faked environment  -- uri rewriting stuff needs the
871 871
 	   original uri
872 872
 	*/
873
+#ifdef _OBSOLETED
873 874
 	memset( &faked_msg, 0, sizeof( struct sip_msg ));
875
+	faked_msg.flags=t->uas.request->flags;	
874 876
 	/* original URI doesn't change -- feel free to refer to shmem */
875 877
 	faked_msg.first_line.u.request.uri=
876 878
 		t->uas.request->first_line.u.request.uri;
879
+#else
880
+    /* 
881
+     on_negative_reply faked msg now copied from shmem msg (as opposed
882
+     to zero-ing) -- more "read-only" actions (exec in particular) will 
883
+     work from reply_route as they will see msg->from, etc.; caution, 
884
+     rw actions may append some pkg stuff to msg, which will possibly be 
885
+     never released (shmem is released in a single block)
886
+    */
887
+	memcpy( &faked_msg, t->uas.request, sizeof(struct sip_msg));
888
+#endif
877 889
 	/* new_uri can change -- make a private copy */
878 890
 	if (t->uas.request->new_uri.s!=0 && t->uas.request->new_uri.len!=0) {
879 891
 		faked_msg.new_uri.s=pkg_malloc(t->uas.request->new_uri.len+1);
... ...
@@ -883,7 +895,6 @@ void on_negative_reply( struct cell* t, struct sip_msg* msg,
883 895
 			faked_msg.new_uri.len);
884 896
 		faked_msg.new_uri.s[faked_msg.new_uri.len]=0;
885 897
 	} else { faked_msg.new_uri.s=0; faked_msg.new_uri.len=0; }
886
-	faked_msg.flags=t->uas.request->flags;	
887 898
 	/* if we set msg_id to something different from current's message
888 899
        id, the first t_fork will properly clean new branch URIs
889 900
 	*/