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

FreeSWITCH SVN mikej at freeswitch.org
Tue Mar 10 12:50:47 PDT 2009


Author: mikej
Date: Tue Mar 10 14:50:46 2009
New Revision: 12550

Log:
Wed Mar  4 13:35:37 CST 2009  Fabio Margarido <fabiomargarido AT gmail DOT com>
  * msg: allow compact headers inside multipart payload



Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Tue Mar 10 14:50:46 2009
@@ -1 +1 @@
-Wed Mar  4 14:42:12 CST 2009
+Tue Mar 10 14:49:50 CDT 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am	Tue Mar 10 14:50:46 2009
@@ -87,7 +87,7 @@
 
 AWK_MSG_AWK = LC_ALL=C $(AWK) -f $(MSG_PARSER_AWK)
 
-${GENERATED_HC}: ${MSG_PARSER_AWK}
+${GENERATED_HC}: ${MSG_PARSER_AWK} Makefile.am
 
 TEST_CLASS_H = ${srcdir}/test_class.h
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h	Tue Mar 10 14:50:46 2009
@@ -168,13 +168,13 @@
   msg_error_t            *mp_error;
 
   /* === Headers start here */
-  msg_content_type_t     *mp_content_type;	/**< Content-Type */
+  msg_content_type_t     *mp_content_type;	/**< Content-Type (c) */
   msg_content_disposition_t *mp_content_disposition;
                                                 /**< Content-Disposition */
   msg_content_location_t *mp_content_location;	/**< Content-Location */
   msg_content_id_t       *mp_content_id;        /**< Content-ID */
   msg_content_language_t *mp_content_language;	/**< Content-Language */
-  msg_content_encoding_t *mp_content_encoding;	/**< Content-Encoding */
+  msg_content_encoding_t *mp_content_encoding;	/**< Content-Encoding (e) */
   msg_content_transfer_encoding_t *mp_content_transfer_encoding;
                                         /**< Content-Transfer-Encoding */
 #if 0

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c	Tue Mar 10 14:50:46 2009
@@ -1193,8 +1193,15 @@
     CRLF			/* 13 */
 #define BODY3 "<html><body>part 3</body></html>" CRLF
     BODY3			/* 14 */
-    CRLF			/* 15 */
-    "--LaGqGt4BI6Ho--" CRLF;
+    CRLF "--LaGqGt4BI6Ho"	/* 15 */
+    "c: text/html" CRLF		/* 16 */
+    "l: 9" CRLF			/* 17 */
+    "e: identity" CRLF		/* 18 */
+    CRLF			/* 19 */
+#define BODY4 "<html/>" CRLF
+    BODY4			  /* 20 */
+    CRLF "--LaGqGt4BI6Ho--"	  /* 21 */
+    CRLF;
 
   BEGIN();
 
@@ -1275,6 +1282,18 @@
   TEST_SIZE(strlen(BODY3), pl->pl_len);
   TEST(memcmp(pl->pl_data, BODY3, pl->pl_len), 0);
 
+  TEST_1(mp = mp->mp_next);
+
+  TEST_1(mp->mp_data);
+  TEST_M(mp->mp_data, CRLF "--" "LaGqGt4BI6Ho" CRLF, mp->mp_len);
+
+  TEST_1(mp->mp_content_encoding);
+  TEST_1(mp->mp_content_type);
+
+  TEST_1(pl = mp->mp_payload); TEST_1(pl->pl_data);
+  TEST_SIZE(strlen(BODY4), pl->pl_len);
+  TEST(memcmp(pl->pl_data, BODY4, pl->pl_len), 0);
+
   mpX = mp;
 
   TEST_1(!(mp = mp->mp_next));
@@ -1293,7 +1312,7 @@
     h->sh_succ = NULL;
   }
 
-  TEST(n, 15);
+  TEST(n, 21);
 
   head = NULL;
   TEST_1(h = msg_multipart_serialize(&head, mp0));
@@ -1304,7 +1323,7 @@
     h_succ = h->sh_succ;
   }
 
-  TEST(n, 15);
+  TEST(n, 21);
 
   /* Add a new part to multipart */
   mpnew = su_zalloc(home, sizeof(*mpnew)); TEST_1(mpnew);
@@ -1324,7 +1343,7 @@
     TEST_1(h != removed);
   }
 
-  TEST(n, 19);
+  TEST(n, 21 + 4);
 
 #define remove(h) \
   (((*((msg_header_t*)(h))->sh_prev = ((msg_header_t*)(h))->sh_succ) ? \
@@ -1336,7 +1355,7 @@
   remove(mp0->mp_separator);
   remove(mp0->mp_next->mp_payload);
   remove(mp0->mp_next->mp_next->mp_content_type);
-  remove(mp0->mp_next->mp_next->mp_next->mp_close_delim);
+  remove(mp0->mp_next->mp_next->mp_next->mp_next->mp_close_delim);
 
   TEST_1(!msg_chain_errors((msg_header_t *)mp0));
 
@@ -1352,7 +1371,7 @@
     TEST_1(h != removed);
   }
 
-  TEST(n, 19);
+  TEST(n, 21 + 4);
 
   /* Add an recursive multipart */
   mpnew = su_zalloc(home, sizeof(*mpnew)); TEST_1(mpnew);
@@ -1371,7 +1390,7 @@
   for (h = (msg_header_t *)mp0, n = 0; h; h = h_succ, n++)
     h_succ = h->sh_succ;
 
-  TEST(n, 24);
+  TEST(n, 21 + 9);
 
   su_home_check(home);
   su_home_zap(home);



More information about the Freeswitch-svn mailing list