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

FreeSWITCH SVN mikej at freeswitch.org
Wed Feb 11 08:48:09 PST 2009


Author: mikej
Date: Wed Feb 11 10:48:09 2009
New Revision: 11797

Log:
Thu Jan  8 13:57:46 CST 2009  Pekka Pessi <first.last at nokia.com>
  * soa: using <sofia-sip/su_string.h> functions



Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Wed Feb 11 10:48:09 2009
@@ -1 +1 @@
-Wed Feb 11 10:47:34 CST 2009
+Wed Feb 11 10:47:59 CST 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c	Wed Feb 11 10:48:09 2009
@@ -52,7 +52,7 @@
 #include <sofia-sip/su_localinfo.h>
 #include <sofia-sip/su_uniqueid.h>
 
-#include <sofia-sip/string0.h>
+#include <sofia-sip/su_string.h>
 #include <sofia-sip/su_errno.h>
 
 #define NONE ((void *)-1)
@@ -172,7 +172,7 @@
     return su_seterrno(EINVAL);
 
   for (n = soa_namelist; n; n = n->next) {
-    if (strcasecmp(name, n->basename) == 0)
+    if (su_casematch(name, n->basename))
       return 0;
   }
 
@@ -197,7 +197,7 @@
     size_t baselen = strcspn(name, ":/");
 
     for (n = soa_namelist; n; n = n->next) {
-      if (strncasecmp(name, n->basename, baselen) == 0)
+      if (su_casenmatch(name, n->basename, baselen))
 	break;
     }
 
@@ -230,7 +230,7 @@
     size_t baselen = strcspn(name, ":/");
 
     for (n = soa_namelist; n; n = n->next) {
-      if (strncasecmp(name, n->basename, baselen) == 0)
+      if (su_casenmatch(name, n->basename, baselen))
 	break;
     }
     if (n == NULL)
@@ -553,7 +553,7 @@
   ss->ss_srtp_confidentiality = srtp_confidentiality;
   ss->ss_srtp_integrity = srtp_integrity;
 
-  if (str0casecmp(media_address, ss->ss_address)) {
+  if (!su_casematch(media_address, ss->ss_address)) {
     su_free(ss->ss_home, (void *)ss->ss_address);
     ss->ss_address = su_strdup(ss->ss_home, media_address);
     change_session = 1;
@@ -562,7 +562,7 @@
   if (hold == (char const *)1)
     hold = "*";
 
-  if (str0casecmp(hold, ss->ss_hold)) {
+  if (!su_casematch(hold, ss->ss_hold)) {
     su_free(ss->ss_home, (void *)ss->ss_hold);
     ss->ss_hold = su_strdup(ss->ss_home, hold);
     change_session = 1;
@@ -1924,7 +1924,7 @@
       l = &l_video, r = &r_video;
     else if (m->m_type == sdp_media_image)
       l = &l_image, r = &r_image;
-    else if (strcasecmp(m->m_type_name, "message") == 0)
+    else if (su_casematch(m->m_type_name, "message"))
       l = &l_chat, r = &r_chat;
     else
       continue;
@@ -2027,8 +2027,7 @@
   else if (sdp_str) {
     if (str_len == -1)
       str_len = strlen(sdp_str);
-    new_version = !ssd->ssd_unparsed ||
-      str0ncmp(sdp_str, ssd->ssd_unparsed, str_len + 1) != 0;
+    new_version = !su_strnmatch(sdp_str, ssd->ssd_unparsed, str_len + 1);
   }
   else
     return (void)su_seterrno(EINVAL), -1;
@@ -2221,7 +2220,7 @@
     su_localinfo_t *li;
 
     for (li = li0; li; li = li->li_next) {
-      if (strncasecmp(li->li_canonname, list, n) == 0 &&
+      if (su_casenmatch(li->li_canonname, list, n) &&
 	  li->li_canonname[n] == '\0')
 	break;
     }

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c	Wed Feb 11 10:48:09 2009
@@ -62,7 +62,7 @@
 #include <sofia-sip/su_tag_class.h>
 #include <sofia-sip/su_tagarg.h>
 #include <sofia-sip/su_strlst.h>
-#include <sofia-sip/string0.h>
+#include <sofia-sip/su_string.h>
 #include <sofia-sip/bnf.h>
 
 #include "sofia-sip/soa.h"
@@ -72,10 +72,6 @@
 #define NONE ((void *)-1)
 #define XXX assert(!"implemented")
 
-#if !HAVE_STRCASESTR
-char *strcasestr(const char *haystack, const char *needle);
-#endif
-
 typedef struct soa_static_session
 {
   soa_session_t sss_session[1];
@@ -175,7 +171,7 @@
 	      SOATAG_REUSE_REJECTED_REF(reuse_rejected),
 	      TAG_END());
 
-  if (n > 0 && str0casecmp(audio_aux, sss->sss_audio_aux)) {
+  if (n > 0 && !su_casematch(audio_aux, sss->sss_audio_aux)) {
     char *s = su_strdup(ss->ss_home, audio_aux), *tbf = sss->sss_audio_aux;
     if (s == NULL && audio_aux != NULL)
       return -1;
@@ -358,7 +354,7 @@
     return 0;
 
   for (match = auxiliary;
-       (match = strcasestr(match, codec));
+       (match = su_strcasestr(match, codec));
        match = match + 1) {
     if (IS_ALPHANUM(match[clen]) || match[clen] == '-')
       continue;
@@ -1009,8 +1005,8 @@
 
   rm = remote ? remote->sdp_media : NULL, rm_next = NULL;
 
-  hold_all = str0cmp(hold, "*") == 0;
-  inactive_all = str0cmp(hold, "#") == 0;
+  hold_all = su_strmatch(hold, "*");
+  inactive_all = su_strmatch(hold, "#");
 
   i = 0;
 
@@ -1051,13 +1047,13 @@
     else if (hold_all) {
       recv_mode = 0;
     }
-    else if (hold && (hold_media = strcasestr(hold, sm->m_type_name))) {
+    else if (hold && (hold_media = su_strcasestr(hold, sm->m_type_name))) {
       recv_mode = 0;
       hold_media += strlen(sm->m_type_name);
       hold_media += strspn(hold_media, " \t");
       if (hold_media[0] == '=') {
 	hold_media += strspn(hold, " \t");
-	if (strncasecmp(hold_media, "inactive", strlen("inactive")) == 0)
+	if (su_casenmatch(hold_media, "inactive", strlen("inactive")))
 	  recv_mode = send_mode = 0;
       }
     }



More information about the Freeswitch-svn mailing list