]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Tue Feb 10 16:55:11 CST 2009 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Thu, 12 Feb 2009 21:01:01 +0000 (21:01 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 12 Feb 2009 21:01:01 +0000 (21:01 +0000)
  * url: accept empty port number in URLs

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11934 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/url/torture_url.c
libs/sofia-sip/libsofia-sip-ua/url/url.c

index eff4840793bcbd49de891ee738bca57e24483f15..98c0e1c66f2d6635f953b461493f8ccfc93ef4ac 100644 (file)
@@ -1 +1 @@
-Wed Feb 11 11:41:31 CST 2009
+Thu Feb 12 15:00:54 CST 2009
index c23f78eef4065ab787e11c9e97371d99f7dfd6cb..4af13fb4f0db80b0810a06b7b429b2966e15f392 100644 (file)
@@ -341,6 +341,9 @@ int test_sip(void)
   u = url_hdup(home, (url_t*)"SIP:test@127.0.0.1:55"); TEST_1(u);
   TEST(u->url_type, url_sip);
 
+  u = url_hdup(home, (url_t*)"SIP:test@127.0.0.1:"); TEST_1(u);
+  TEST(u->url_type, url_sip);
+
   TEST_P(url_hdup(home, (url_t*)"sip:test@127.0.0.1::55"), NULL);
   TEST_P(url_hdup(home, (url_t*)"sip:test@127.0.0.1:55:"), NULL);
   TEST_P(url_hdup(home, (url_t*)"sip:test@127.0.0.1:sip"), NULL);
index 4be736e1e9d634a0619767dcd29381bb60c7bd62..f9d31b2ea6a7eb1de216d914af617265b6f6aed4 100644 (file)
@@ -713,8 +713,15 @@ int _url_d(url_t *url, char *s)
        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;