summaryrefslogtreecommitdiff
path: root/libsoup/soup-form.c
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2020-08-31 17:24:21 -0500
committerPatrick Griffis <pgriffis@igalia.com>2020-08-31 17:34:22 -0500
commitb57fee6c73f319df381c8483a9083beda22fcf3d (patch)
tree1c071432025dbbba4e71f1623b72ce85b1ecaf20 /libsoup/soup-form.c
parent31343377f1944d3dc2d994e25d7663504325841e (diff)
downloadlibsoup-wip/remove-deprecations.tar.gz
Replace SoupBuffer with GByteswip/remove-deprecations
Diffstat (limited to 'libsoup/soup-form.c')
-rw-r--r--libsoup/soup-form.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libsoup/soup-form.c b/libsoup/soup-form.c
index aa0974f2..1de391d1 100644
--- a/libsoup/soup-form.c
+++ b/libsoup/soup-form.c
@@ -133,7 +133,7 @@ soup_form_decode (const char *encoded_form)
* care about those fields. soup_form_decode_multipart() may also
* return %NULL in those fields if the client did not provide that
* information. You must free the returned filename and content-type
- * with g_free(), and the returned file data with soup_buffer_free().
+ * with g_free(), and the returned file data with g_bytes_unref().
*
* If you have a form with more than one file upload control, you will
* need to decode it manually, using soup_multipart_new_from_message()
@@ -149,12 +149,12 @@ soup_form_decode (const char *encoded_form)
GHashTable *
soup_form_decode_multipart (SoupMessage *msg, const char *file_control_name,
char **filename, char **content_type,
- SoupBuffer **file)
+ GBytes **file)
{
SoupMultipart *multipart;
GHashTable *form_data_set, *params;
SoupMessageHeaders *part_headers;
- SoupBuffer *part_body;
+ GBytes *part_body;
char *disposition, *name;
int i;
@@ -193,12 +193,12 @@ soup_form_decode_multipart (SoupMessage *msg, const char *file_control_name,
if (content_type)
*content_type = g_strdup (soup_message_headers_get_content_type (part_headers, NULL));
if (file)
- *file = soup_buffer_copy (part_body);
+ *file = g_bytes_ref (part_body);
} else {
g_hash_table_insert (form_data_set,
g_strdup (name),
- g_strndup (part_body->data,
- part_body->length));
+ g_strndup (g_bytes_get_data (part_body, NULL),
+ g_bytes_get_size (part_body)));
}
g_free (disposition);