Reapplying patch to disable attempts to use gtk-doc
[profile/ivi/libsoup2.4.git] / libsoup / soup-message-body.c
index daf9d1e..9a6ad75 100644 (file)
@@ -308,6 +308,26 @@ soup_buffer_free (SoupBuffer *buffer)
        }
 }
 
+/**
+ * soup_buffer_get_as_bytes:
+ * @buffer: a #SoupBuffer
+ *
+ * Returns: (transfer full): a new #GBytes which has the same content
+ * as the #SoupBuffer.
+ *
+ * Since: 2.40
+ */
+GBytes *
+soup_buffer_get_as_bytes (SoupBuffer *buffer)
+{
+       SoupBuffer *copy;
+
+       copy = soup_buffer_copy (buffer);
+       return g_bytes_new_with_free_func (copy->data, copy->length,
+                                          (GDestroyNotify)soup_buffer_free,
+                                          copy);
+}
+
 GType
 soup_buffer_get_type (void)
 {