[asterisk-commits] Support GMIME 3.0 (asterisk[15])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 7 08:00:26 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6153 )

Change subject: Support GMIME 3.0
......................................................................

Support GMIME 3.0

Support building the Asterisk httpd with version 3.0 of gmime as
well as earlier versions of that library.

ASTERISK-27173

Change-Id: I7e13dd05a3083ccb0df2dabf83110223f6a9fa8f
---
M configure
M configure.ac
M res/res_http_post.c
3 files changed, 19 insertions(+), 4 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/configure b/configure
index 5bb7523..c25f031 100755
--- a/configure
+++ b/configure
@@ -34582,7 +34582,7 @@
     fi
 fi
 
-for ver in 2.0 2.2 2.4 2.6; do
+for ver in 2.0 2.2 2.4 2.6 3.0; do
 
    if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
 
diff --git a/configure.ac b/configure.ac
index a2eaab4..0c392ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2548,7 +2548,7 @@
     fi
 fi
 
-for ver in 2.0 2.2 2.4 2.6; do
+for ver in 2.0 2.2 2.4 2.6 3.0; do
 	AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)
 	if test "$PBX_GMIME" = 1; then
 		break;
diff --git a/res/res_http_post.c b/res/res_http_post.c
index 3f0a58e..9f5b183 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -55,6 +55,9 @@
 #ifdef GMIME_TYPE_CONTENT_TYPE
 #define AST_GMIME_VER_24
 #endif
+#if GMIME_MAJOR_VERSION >= 3
+#define AST_GMIME_VER_30
+#endif
 
 /* just a little structure to hold callback info for gmime */
 struct mime_cbinfo {
@@ -84,7 +87,11 @@
 
 	stream = g_mime_stream_fs_new(fd);
 
+#ifdef AST_GMIME_VER_30
+	content = g_mime_part_get_content(part);
+#else
 	content = g_mime_part_get_content_object(part);
+#endif
 	g_mime_data_wrapper_write_to_stream(content, stream);
 	g_mime_stream_flush(stream);
 
@@ -107,7 +114,11 @@
 	
 	g_object_unref(stream);
 
-	message = g_mime_parser_construct_message(parser);
+	message = g_mime_parser_construct_message(parser
+#ifdef AST_GMIME_VER_30
+			, NULL
+#endif
+	);
 
 	g_object_unref(parser);
 
@@ -486,7 +497,11 @@
 
 static int load_module(void)
 {
-	g_mime_init(0);
+	g_mime_init(
+#ifndef AST_GMIME_VER_30
+			0
+#endif
+	);
 
 	__ast_http_post_load(0);
 

-- 
To view, visit https://gerrit.asterisk.org/6153
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I7e13dd05a3083ccb0df2dabf83110223f6a9fa8f
Gerrit-Change-Number: 6153
Gerrit-PatchSet: 1
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170807/bc99a03a/attachment-0001.html>


More information about the asterisk-commits mailing list