2
0
Эх сурвалжийг харах

core: dset - wrapper function to reset request uri

Daniel-Constantin Mierla 2 сар өмнө
parent
commit
e01f50fa3d
2 өөрчлөгдсөн 18 нэмэгдсэн , 0 устгасан
  1. 16 0
      src/core/dset.c
  2. 2 0
      src/core/dset.h

+ 16 - 0
src/core/dset.c

@@ -813,6 +813,22 @@ int rewrite_uri(struct sip_msg *_m, str *_s)
 	return 1;
 }
 
+/*
+ * Reset Request-URI
+ */
+void reset_uri(sip_msg_t *msg)
+{
+	if(msg->new_uri.s == NULL) {
+		return;
+	}
+	pkg_free(msg->new_uri.s);
+	msg->new_uri.len = 0;
+	msg->new_uri.s = 0;
+	msg->parsed_uri_ok = 0;
+	ruri_mark_new();
+	return;
+}
+
 /**
  * return src ip, port and proto as a SIP uri or proxy address
  * - value stored in a static buffer

+ 2 - 0
src/core/dset.h

@@ -233,6 +233,8 @@ inline static int get_request_uri(struct sip_msg *_m, str *_u)
 
 int rewrite_uri(struct sip_msg *_m, str *_s);
 
+void reset_uri(sip_msg_t *msg);
+
 /*! \brief
  * Set a per-branch flag to 1.
  *