summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-08-07 07:58:05 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-08-07 07:58:05 -0500
commitc9e5d78311015e25a99ec91c260dc9c260747b56 (patch)
treea390539fed8ed4947580d2f2a9036960baaedc87 /res
parent8fc5c28fe3103669847d3bb0f8c1a2599b4705f3 (diff)
parent2c535c798410bc08a53f779866898205da4d2f1e (diff)
Merge "Support GMIME 3.0" into 14
Diffstat (limited to 'res')
-rw-r--r--res/res_http_post.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/res/res_http_post.c b/res/res_http_post.c
index 37fc4fa09..10db6756f 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -57,6 +57,9 @@ ASTERISK_REGISTER_FILE()
#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 {
@@ -86,7 +89,11 @@ static void post_raw(GMimePart *part, const char *post_dir, const char *fn)
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);
@@ -109,7 +116,11 @@ static GMimeMessage *parse_message(FILE *f)
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);
@@ -488,7 +499,11 @@ static int reload(void)
static int load_module(void)
{
- g_mime_init(0);
+ g_mime_init(
+#ifndef AST_GMIME_VER_30
+ 0
+#endif
+ );
__ast_http_post_load(0);