[Freeswitch-svn] [commit] r11934 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/url

FreeSWITCH SVN mikej at freeswitch.org
Thu Feb 12 13:01:01 PST 2009


Author: mikej
Date: Thu Feb 12 15:01:01 2009
New Revision: 11934

Log:
Tue Feb 10 16:55:11 CST 2009  Pekka Pessi <first.last at nokia.com>
  * url: accept empty port number in URLs



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

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Thu Feb 12 15:01:01 2009
@@ -1 +1 @@
-Wed Feb 11 11:41:31 CST 2009
+Thu Feb 12 15:00:54 CST 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c	Thu Feb 12 15:01:01 2009
@@ -341,6 +341,9 @@
   u = url_hdup(home, (url_t*)"SIP:test at 127.0.0.1:55"); TEST_1(u);
   TEST(u->url_type, url_sip);
 
+  u = url_hdup(home, (url_t*)"SIP:test at 127.0.0.1:"); TEST_1(u);
+  TEST(u->url_type, url_sip);
+
   TEST_P(url_hdup(home, (url_t*)"sip:test at 127.0.0.1::55"), NULL);
   TEST_P(url_hdup(home, (url_t*)"sip:test at 127.0.0.1:55:"), NULL);
   TEST_P(url_hdup(home, (url_t*)"sip:test at 127.0.0.1:sip"), NULL);

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	Thu Feb 12 15:01:01 2009
@@ -713,8 +713,15 @@
 	while (*port >= '0' && *port <= '9')
 	  port++;
 
-	if (port != url->url_port ? port[0] != '\0'
-	    : (port[0] != '*' || port[1] != '\0'))
+	if (port != url->url_port) {
+	  if (port[0] != '\0')
+	    return -1;
+	}
+	else if (port[0] == '\0')
+	  /* empty string */;
+	else if (port[0] == '*' && port[1] == '\0')
+	  /* wildcard */;
+	else
 	  return -1;
       }
       host[n] = 0;



More information about the Freeswitch-svn mailing list