aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-08-13 23:41:10 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-13 23:42:12 +0800
commitff88d1f11176233438cace72da46a54c479495ab (patch)
tree65b50784bfb0aae944353c423dd3d85e3d2bbc89 /modules
parente41f778ba755f955fa33684d3f26615d3a91204a (diff)
downloadgsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.tar
gsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.tar.gz
gsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.tar.bz2
gsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.tar.lz
gsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.tar.xz
gsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.tar.zst
gsoc2013-evolution-ff88d1f11176233438cace72da46a54c479495ab.zip
Bug 681321 - Support both old and new-buf libxml2 APIs
libxml2 changed the API for xmlOutputBuffer incompatibly. See https://mail.gnome.org/archives/desktop-devel-list/2012-August/msg00004.html
Diffstat (limited to 'modules')
-rw-r--r--modules/cal-config-caldav/e-caldav-chooser.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/cal-config-caldav/e-caldav-chooser.c b/modules/cal-config-caldav/e-caldav-chooser.c
index 55143f0d4c..fa5c9b7fc1 100644
--- a/modules/cal-config-caldav/e-caldav-chooser.c
+++ b/modules/cal-config-caldav/e-caldav-chooser.c
@@ -111,6 +111,19 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (
E_TYPE_SOURCE_AUTHENTICATOR,
e_caldav_chooser_authenticator_init))
+static gconstpointer
+compat_libxml_output_buffer_get_content (xmlOutputBufferPtr buf,
+ gsize *out_len)
+{
+#ifdef LIBXML2_NEW_BUFFER
+ *out_len = xmlOutputBufferGetSize (buf);
+ return xmlOutputBufferGetContent (buf);
+#else
+ *out_len = buf->buffer->use;
+ return buf->buffer->content;
+#endif
+}
+
static void
context_cancel_message (GCancellable *cancellable,
Context *context)
@@ -203,6 +216,8 @@ caldav_chooser_new_propfind (SoupSession *session,
xmlNodePtr node;
xmlNsPtr ns;
xmlOutputBufferPtr output;
+ gconstpointer content;
+ gsize length;
gpointer key;
va_list va;
@@ -268,9 +283,11 @@ caldav_chooser_new_propfind (SoupSession *session,
xmlNodeDumpOutput (output, doc, root, 0, 1, NULL);
xmlOutputBufferFlush (output);
+ content = compat_libxml_output_buffer_get_content (output, &length);
+
soup_message_set_request (
message, "application/xml", SOUP_MEMORY_COPY,
- (gchar *) output->buffer->content, output->buffer->use);
+ content, length);
xmlOutputBufferClose (output);