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

Freeswitch SVN mikej at freeswitch.org
Sun May 25 09:56:27 EDT 2008


Author: mikej
Date: Sun May 25 09:56:27 2008
New Revision: 8613

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

Log:
Tue May 20 09:32:10 EDT 2008  Pekka.Pessi at nokia.com
  * sip_mime.c: use msg_content_type functions with sip_content_type


Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Sun May 25 09:56:27 2008
@@ -1 +1 @@
-Sun May 25 09:55:22 EDT 2008
+Sun May 25 09:56:21 EDT 2008

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c	Sun May 25 09:56:27 2008
@@ -554,46 +554,18 @@
 
 issize_t sip_content_type_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen)
 {
-  sip_content_type_t *c;
-
-  assert(h);
-
-  c = h->sh_content_type;
-
-  /* "Content-type:" type/subtyp *(; parameter))) */
-  if (/* Parse protocol */
-      sip_version_d(&s, &c->c_type) == -1 || /* compacts token / token */
-      (c->c_subtype = strchr(c->c_type, '/')) == NULL ||
-      (*s == ';' && msg_params_d(home, &s, &c->c_params) == -1) ||
-      (*s != '\0'))
-    return -1;
-
-  c->c_subtype++;
-
-  return 0;
+  return msg_content_type_d(home, (msg_header_t *)h, s, slen);
 }
 
 issize_t sip_content_type_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
 {
-  char *b0 = b, *end = b + bsiz;
-  sip_content_type_t const *c = h->sh_content_type;
-
-  MSG_STRING_E(b, end, c->c_type);
-  MSG_PARAMS_E(b, end, c->c_params, flags);
-  MSG_TERM_E(b, end);
-
-  return b - b0;
+  return msg_content_type_e(b, bsiz, (msg_header_t const *)h, flags);
 }
 
 static
 isize_t sip_content_type_dup_xtra(sip_header_t const *h, isize_t offset)
 {
-  sip_content_type_t const *c = h->sh_content_type;
-
-  MSG_PARAMS_SIZE(offset, c->c_params);
-  offset += MSG_STRING_SIZE(c->c_type);
-
-  return offset;
+  return msg_content_type_dup_xtra((msg_header_t *)h, offset);
 }
 
 /** Duplicate one #sip_content_type_t object */ 
@@ -601,18 +573,9 @@
 char *sip_content_type_dup_one(sip_header_t *dst, sip_header_t const *src,
 			       char *b, isize_t xtra)
 {
-  sip_content_type_t *c = dst->sh_content_type;
-  sip_content_type_t const *o = src->sh_content_type;
-  char *end = b + xtra;
-
-  b = msg_params_dup(&c->c_params, o->c_params, b, xtra);
-  MSG_STRING_DUP(b, c->c_type, o->c_type);
-  c->c_subtype = strchr(c->c_type, '/');
-  c->c_subtype++;
-
-  assert(b <= end); (void)end;
-
-  return b;
+  return msg_content_type_dup_one((msg_header_t *)dst,
+				  (msg_header_t const *)src,
+				  b, xtra);
 }
 
 /* ====================================================================== */



More information about the Freeswitch-svn mailing list