diff options
author | Mark Doffman <mark.doffman@codethink.co.uk> | 2014-04-01 20:02:03 +0000 |
---|---|---|
committer | Mark Doffman <mark.doffman@codethink.co.uk> | 2014-04-01 20:02:03 +0000 |
commit | ce764489e358bad6b49418f5c8bc7b25a4b1815e (patch) | |
tree | bdf7d009702adc91e63d261f7d924d9e5bf94cff /libsoup/soup-request-data.c | |
parent | 0d45677b0a20270735e4d18e969a4991a4e67078 (diff) | |
parent | 6c14af04775a9de4dfa3fa0cc15a7ad0462ef3d9 (diff) | |
download | libsoup-baserock/morph.tar.gz |
Merge tag '2.46.0' into baserock/morphbaserock/morph
2.46.0
Diffstat (limited to 'libsoup/soup-request-data.c')
-rw-r--r-- | libsoup/soup-request-data.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libsoup/soup-request-data.c b/libsoup/soup-request-data.c index 933d7522..678e84da 100644 --- a/libsoup/soup-request-data.c +++ b/libsoup/soup-request-data.c @@ -25,14 +25,19 @@ #include <config.h> #endif -#include <glib/gi18n-lib.h> - -#define LIBSOUP_USE_UNSTABLE_REQUEST_API +#include <string.h> #include "soup-request-data.h" #include "soup.h" #include "soup-misc-private.h" +/** + * SECTION:soup-request-data + * @short_description: SoupRequest support for "data" URIs + * + * #SoupRequestData implements #SoupRequest for "data" URIs. + */ + G_DEFINE_TYPE (SoupRequestData, soup_request_data, SOUP_TYPE_REQUEST) struct _SoupRequestDataPrivate { @@ -91,7 +96,7 @@ soup_request_data_send (SoupRequest *request, end = comma; if (end != start) - data->priv->content_type = uri_decoded_copy (start, end - start); + data->priv->content_type = soup_uri_decoded_copy (start, end - start, NULL); } memstream = g_memory_input_stream_new (); @@ -100,12 +105,14 @@ soup_request_data_send (SoupRequest *request, start = comma + 1; if (*start) { - guchar *buf = (guchar *) soup_uri_decode (start); + int decoded_length = 0; + guchar *buf = (guchar *) soup_uri_decoded_copy (start, strlen (start), + &decoded_length); if (base64) buf = g_base64_decode_inplace ((gchar*) buf, &data->priv->content_length); else - data->priv->content_length = strlen ((const char *) buf); + data->priv->content_length = decoded_length; g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (memstream), buf, data->priv->content_length, |