mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Merge "Support GMIME 3.0" into 13
This commit is contained in:
2
configure
vendored
2
configure
vendored
@@ -33252,7 +33252,7 @@ fi
|
|||||||
fi
|
fi
|
||||||
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
|
if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
|
||||||
|
|
||||||
|
@@ -2502,7 +2502,7 @@ then
|
|||||||
fi
|
fi
|
||||||
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)
|
AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)
|
||||||
if test "$PBX_GMIME" = 1; then
|
if test "$PBX_GMIME" = 1; then
|
||||||
break;
|
break;
|
||||||
|
@@ -57,6 +57,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#ifdef GMIME_TYPE_CONTENT_TYPE
|
#ifdef GMIME_TYPE_CONTENT_TYPE
|
||||||
#define AST_GMIME_VER_24
|
#define AST_GMIME_VER_24
|
||||||
#endif
|
#endif
|
||||||
|
#if GMIME_MAJOR_VERSION >= 3
|
||||||
|
#define AST_GMIME_VER_30
|
||||||
|
#endif
|
||||||
|
|
||||||
/* just a little structure to hold callback info for gmime */
|
/* just a little structure to hold callback info for gmime */
|
||||||
struct mime_cbinfo {
|
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);
|
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);
|
content = g_mime_part_get_content_object(part);
|
||||||
|
#endif
|
||||||
g_mime_data_wrapper_write_to_stream(content, stream);
|
g_mime_data_wrapper_write_to_stream(content, stream);
|
||||||
g_mime_stream_flush(stream);
|
g_mime_stream_flush(stream);
|
||||||
|
|
||||||
@@ -109,7 +116,11 @@ static GMimeMessage *parse_message(FILE *f)
|
|||||||
|
|
||||||
g_object_unref(stream);
|
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);
|
g_object_unref(parser);
|
||||||
|
|
||||||
@@ -488,7 +499,11 @@ static int reload(void)
|
|||||||
|
|
||||||
static int load_module(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);
|
__ast_http_post_load(0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user