[Freeswitch-svn] [commit] r3898 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url

Freeswitch SVN mikej at freeswitch.org
Tue Jan 2 18:44:44 EST 2007


Author: mikej
Date: Tue Jan  2 18:44:44 2007
New Revision: 3898

Modified:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c

Log:
allow unescaped # in username portion of uri even though it is agains rfc 2396, to be more compatible with broken ua's as there are many who do not properly escape a # in the uri

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c	Tue Jan  2 18:44:44 2007
@@ -592,9 +592,14 @@
 
   if (url->url_type == url_sip || url->url_type == url_sips) {
     /* SIP URL may have /; in user part */
-    n = strcspn(s, "@#");	/* Opaque part */
-    if (s[n] != '@')
-      n = 0;
+    n = strcspn(s, "@");	/* Opaque part */
+	if (n == strlen(s)) {
+		if ((strchr(s, '#')))
+			n = 0;
+	} else {
+		if (strchr(s + n, '#'))
+			n = 0;
+	}
     n += strcspn(s + n, "/;?#");
   }
   else if (url->url_type == url_wv) {



More information about the Freeswitch-svn mailing list