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

FreeSWITCH SVN brian at freeswitch.org
Tue Feb 24 06:46:03 PST 2009


Author: brian
Date: Tue Feb 24 08:46:03 2009
New Revision: 12261

Log:
Tue Feb 24 07:33:35 CST 2009  Pekka Pessi <first.last at nokia.com>
  * sip_parser.c: fixed sip_transport_d()
  Ignore-this: c14408145a269c25d00dcb20ab2391f6
  
  sip_transport_d() was expected to canonize casing of well-known transports.
  
  Thanks for Adrian Gschwend for reporting the problem.



Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Tue Feb 24 08:46:03 2009
@@ -1 +1 @@
-Tue Feb 24 08:43:18 CST 2009
+Tue Feb 24 08:44:37 CST 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c	Tue Feb 24 08:46:03 2009
@@ -459,8 +459,9 @@
   size_t pn_len, pv_len, pt_len;
   char *s = *ss;
 
-#define TRANSPORT_MATCH(t)					     \
-  (su_casenmatch(s + 7, t + 7, (sizeof t) - 8) && (IS_LWS(s[sizeof(t)])) \
+#define TRANSPORT_MATCH(t) \
+  (su_casenmatch(s + 7, t + 7, (sizeof t) - 8) && \
+   (!s[sizeof(t) - 1] || IS_LWS(s[sizeof(t) - 1]))	\
    && (transport = t, s += sizeof(t) - 1))
 
   if (!su_casenmatch(s, "SIP/2.0", 7) ||

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c	Tue Feb 24 08:46:03 2009
@@ -711,6 +711,31 @@
   }
 
   {
+    char *input;
+    char const *output = NULL;
+    char udp[] = "sip/2.0/udp";
+    char tcp[] = "sip/2.0/tCp ";
+    char sctp[] = "sip/2.0/sctp\t";
+    char tls[] = "sip/2.0/tls\r";
+
+    input = udp;
+    TEST(sip_transport_d(&input, &output), 0);
+    TEST_S(output, "SIP/2.0/UDP");
+
+    input = tcp;
+    TEST(sip_transport_d(&input, &output), 0);
+    TEST_S(output, "SIP/2.0/TCP");
+
+    input = sctp;
+    TEST(sip_transport_d(&input, &output), 0);
+    TEST_S(output, "SIP/2.0/SCTP");
+
+    input = tls;
+    TEST(sip_transport_d(&input, &output), 0);
+    TEST_S(output, "SIP/2.0/TLS");
+  }
+
+  {
     sip_expires_t *ex;
 
     TEST_1(!sip_expires_make(home, "-12+1"));
@@ -2323,7 +2348,7 @@
   TEST_S(www->au_scheme, "Kerberos");
   TEST_1(www = www->au_next);
   TEST_S(www->au_scheme, "NTLM");
-  
+ 
   msg_destroy(msg);
 
   END();



More information about the Freeswitch-svn mailing list