[asterisk-commits] pabelanger: trunk r319086 - in /trunk: ./ include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 16 09:38:21 CDT 2011


Author: pabelanger
Date: Mon May 16 09:38:16 2011
New Revision: 319086

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319086
Log:
Merged revisions 319085 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r319085 | pabelanger | 2011-05-16 10:35:21 -0400 (Mon, 16 May 2011) | 10 lines
  
  Support gmime-2.4
  
  (closes issue #18863)
  Reported by: tzafrir
  Patches:
        gmime-2.4-18.diff uploaded by tzafrir (license 46)
        Tested by: tzafrir
  
  Review: https://reviewboard.asterisk.org/r/1213/
........

Modified:
    trunk/   (props changed)
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in
    trunk/res/res_http_post.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=319086&r1=319085&r2=319086
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon May 16 09:38:16 2011
@@ -2018,18 +2018,17 @@
 AST_EXT_TOOL_CHECK([GMIME], [gmime-config], [], [], [#include <gmime/gmime.h>], [gboolean q = g_mime_check_version(0,0,0);])
 if test "x${PBX_GMIME}" = "x0"; then
 	# Later versions of GMime use pkg-config
-	if test "x${PKGCONFIG}" = xNo; then :; else
-		GMIME_INCLUDE=$(${PKGCONFIG} gmime-2.0 --cflags 2>/dev/null)
-		GMIME_LIB=$(${PKGCONFIG} gmime-2.0 --libs)
-		if test "x${GMIME_INCLUDE}${GMIME_LIB}" = "x"; then 
-			GMIME_INCLUDE=$(${PKGCONFIG} gmime-2.2 --cflags 2>/dev/null)
-			GMIME_LIB=$(${PKGCONFIG} gmime-2.2 --libs)
+	for ver in 2.0 2.2 2.4; do
+		if ! ${PKGCONFIG} --exists gmime-$ver; then
+			continue
 		fi
-		if test "x${GMIME_INCLUDE}${GMIME_LIB}" != "x"; then
-			PBX_GMIME=1
-			AC_DEFINE([HAVE_GMIME], 1, [Define if your system has the GMIME libraries.])
-		fi
-	fi
+		# If we got here, we have this version:
+		GMIME_INCLUDE=$(${PKGCONFIG} gmime-$ver --cflags 2>/dev/null)
+		GMIME_LIB=$(${PKGCONFIG} gmime-$ver --libs)
+		PBX_GMIME=1
+		AC_DEFINE([HAVE_GMIME], 1, [Define if your system has the GMIME libraries.])
+		break;
+	done
 fi
 
 AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], [])

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=319086&r1=319085&r2=319086
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Mon May 16 09:38:16 2011
@@ -827,16 +827,16 @@
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
-/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
 
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
-/* Define to 1 if `cr_uid' is member of `struct ucred'. */
+/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_CR_UID
 
-/* Define to 1 if `uid' is member of `struct ucred'. */
+/* Define to 1 if `uid' is a member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_UID
 
 /* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1113,6 +1113,9 @@
 
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
 
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION

Modified: trunk/res/res_http_post.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_http_post.c?view=diff&rev=319086&r1=319085&r2=319086
==============================================================================
--- trunk/res/res_http_post.c (original)
+++ trunk/res/res_http_post.c Mon May 16 09:38:16 2011
@@ -52,6 +52,11 @@
 
 #define MAX_PREFIX 80
 
+/* gmime 2.4 provides a newer interface. */
+#ifdef GMIME_TYPE_CONTENT_TYPE
+#define AST_GMIME_VER_24
+#endif
+
 /* just a little structure to hold callback info for gmime */
 struct mime_cbinfo {
 	int count;
@@ -84,7 +89,9 @@
 	g_mime_data_wrapper_write_to_stream(content, stream);
 	g_mime_stream_flush(stream);
 
+#ifndef AST_GMIME_VER_24
 	g_object_unref(content);
+#endif
 	g_object_unref(stream);
 }
 
@@ -108,7 +115,11 @@
 	return message;
 }
 
+#ifdef AST_GMIME_VER_24
+static void process_message_callback(GMimeObject *parent, GMimeObject *part, gpointer user_data)
+#else
 static void process_message_callback(GMimeObject *part, gpointer user_data)
+#endif
 {
 	struct mime_cbinfo *cbinfo = user_data;
 
@@ -122,6 +133,7 @@
 		ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MESSAGE_PARTIAL\n");
 		return;
 	} else if (GMIME_IS_MULTIPART(part)) {
+#ifndef AST_GMIME_VER_24
 		GList *l;
 
 		ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MULTIPART, trying to process subparts\n");
@@ -130,6 +142,9 @@
 			process_message_callback(l->data, cbinfo);
 			l = l->next;
 		}
+#else
+		ast_log(LOG_WARNING, "Got unexpected MIME subpart.\n");
+#endif
 	} else if (GMIME_IS_PART(part)) {
 		const char *filename;
 
@@ -151,7 +166,11 @@
 		.post_dir = post_dir,
 	};
 
+#ifdef AST_GMIME_VER_24
+	g_mime_message_foreach(message, process_message_callback, &cbinfo);
+#else
 	g_mime_message_foreach_part(message, process_message_callback, &cbinfo);
+#endif
 
 	return cbinfo.count;
 }




More information about the asterisk-commits mailing list