[vala] libsoup-2.4: deprecate Buffer.new and MessageBody.append



commit 0559fb7aa3210877a47780e03f4b836c42c8491a
Author: Evan Nemerson <evan nemerson com>
Date:   Tue May 27 21:42:10 2014 -0700

    libsoup-2.4: deprecate Buffer.new and MessageBody.append
    
    These functions require the user to correctly specify a Soup.MemoryUse
    argument, but that's easy to get wrong without understanding how the
    memory is managed.  Alternatives for these functions which will always
    transfer ownership of the memory have been in place since 2.32, so
    from now on we will emit a warning when someone tries to use the old
    versions.

 vapi/libsoup-2.4.vapi           |    2 ++
 vapi/metadata/Soup-2.4.metadata |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/vapi/libsoup-2.4.vapi b/vapi/libsoup-2.4.vapi
index 78c0dbe..6392488 100644
--- a/vapi/libsoup-2.4.vapi
+++ b/vapi/libsoup-2.4.vapi
@@ -207,6 +207,7 @@ namespace Soup {
                public uint8[] data;
                public size_t length;
                [CCode (has_construct_function = false)]
+               [Deprecated (replacement = "Buffer.take", since = "2.32")]
                public Buffer (Soup.MemoryUse use, [CCode (array_length_cname = "length", array_length_pos = 
2.1, array_length_type = "gsize", type = "gconstpointer")] uint8[] data);
                public Soup.Buffer copy ();
                public void free ();
@@ -465,6 +466,7 @@ namespace Soup {
                public int64 length;
                [CCode (has_construct_function = false)]
                public MessageBody ();
+               [Deprecated (replacement = "MessageBody.append_take", since = "2.32")]
                public void append (Soup.MemoryUse use, [CCode (array_length_cname = "length", 
array_length_pos = 2.1, array_length_type = "gsize")] uint8[] data);
                public void append_buffer (Soup.Buffer buffer);
                public void append_take ([CCode (array_length_cname = "length", array_length_pos = 1.1, 
array_length_type = "gsize")] owned uint8[] data);
diff --git a/vapi/metadata/Soup-2.4.metadata b/vapi/metadata/Soup-2.4.metadata
index 7f63bb8..16a9c48 100644
--- a/vapi/metadata/Soup-2.4.metadata
+++ b/vapi/metadata/Soup-2.4.metadata
@@ -86,3 +86,9 @@ xmlrpc_request_new sentinel="G_TYPE_INVALID"
 xmlrpc_set_fault printf_format
 xmlrpc_set_response sentinel="G_TYPE_INVALID"
 xmlrpc_build_fault printf_format
+
+// Simplify memory management
+Buffer
+  .new deprecated_since="2.32" replacement="Buffer.take"
+MessageBody
+  .append deprecated_since="2.32" replacement="MessageBody.append_take"
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]