[SR-Dev] git:master: @ruri forces parsing the URI.

Miklos Tirpak miklos at iptel.org
Fri May 15 10:13:50 CEST 2009


Module: sip-router
Branch: master
Commit: 3e004ccaddd1d9a671dac012021116c7bda2c733
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3e004ccaddd1d9a671dac012021116c7bda2c733

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Miklos Tirpak <miklos at iptel.org>
Date:   Fri May 15 10:04:50 2009 +0200

@ruri forces parsing the URI.

The entire RURI value is rearly used as it is,
rather its subparts are important. The result of this
patch is that for example @ruri.user and @ruri.host
cause one parsing instead of two when the RURI has
not been parsed yet.

---

 select_core.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/select_core.c b/select_core.c
index 8f7c0f5..0ecd1c9 100644
--- a/select_core.c
+++ b/select_core.c
@@ -69,6 +69,16 @@
 
 int select_ruri(str* res, select_t* s, struct sip_msg* msg)
 {
+	/* Parse the RURI even if it is not needed right now
+	 * because the nested select calls can access the
+	 * parsed URI in this case.
+	 * Go ahead even if the parsing fails, so the
+	 * value of the broken RURI can be accessed at least.
+	 * Subsequent select calls will fail when they try to parse
+	 * the URI anyway. (Miklos)
+	 */
+	parse_sip_msg_uri(msg);
+
 	if (msg->parsed_uri_ok)
 		select_uri_p = &msg->parsed_uri;
 




More information about the sr-dev mailing list