aboutsummaryrefslogtreecommitdiffstats
path: root/mail/evolution/files/patch-support-libxml2-2.9
blob: 57f833cc9cea550f5be0204695401b0544371466 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- plugins/caldav/caldav-browse-server.c.ori   2013-03-02 12:33:59.220751490 -0300
+++ plugins/caldav/caldav-browse-server.c   2013-03-02 16:47:55.601296985 -0300
@@ -63,6 +63,18 @@
 
 typedef void (*process_message_cb) (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *msg_body, gpointer user_data);
 
+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 send_xml_message (xmlDocPtr doc, gboolean depth_1, const gchar *url, GObject *dialog, process_message_cb cb, gpointer cb_user_data, const gchar *info);
 
 static gchar *
@@ -953,6 +965,8 @@
    SoupSession *session;
    SoupMessage *message;
    xmlOutputBufferPtr buf;
+   gconstpointer content;
+   gsize length;
    guint poll_id;
    struct poll_data *pd;
 
@@ -977,9 +991,11 @@
    xmlNodeDumpOutput (buf, doc, xmlDocGetRootElement (doc), 0, 1, NULL);
    xmlOutputBufferFlush (buf);
 
+   content = compat_libxml_output_buffer_get_content (buf, &length);
+
    soup_message_headers_append (message->request_headers, "User-Agent", "Evolution/" VERSION);
    soup_message_headers_append (message->request_headers, "Depth", depth_1 ? "1" : "0");
-   soup_message_set_request (message, "application/xml", SOUP_MEMORY_COPY, (const gchar *) buf->buffer->content, buf->buffer->use);
+   soup_message_set_request (message, "application/xml", SOUP_MEMORY_COPY, content, length);
 
    /* Clean up the memory */
    xmlOutputBufferClose (buf);