diff options
author | Rob Bradford <rob@linux.intel.com> | 2013-07-10 11:25:37 +0100 |
---|---|---|
committer | Rob Bradford <rob@linux.intel.com> | 2013-07-10 11:25:37 +0100 |
commit | 44a8807768cc0a30e03151780582c1f00170ab38 (patch) | |
tree | 64e08de11c13cf584be2f76f16d373c7b058a32b | |
parent | 8449b010aa23fb3dd6add35e228a7ae5e67a598f (diff) |
rest-proxy-call: Include the zero byte added by soup to the payload
In the previous commit the downloading of binary data was fixed -
unfortunately this broke the behaviour of downloading textual data where
the clients expect a NUL terminated string for the payload.
This change makes sure to include the zero byte that soup adds to
support this use case and as a result the test suite passes.
-rw-r--r-- | rest/rest-proxy-call.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index c84291e..a6533c3 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -608,7 +608,8 @@ finish_call (RestProxyCall *call, SoupMessage *message, GError **error) (SoupMessageHeadersForeachFunc)_populate_headers_hash_table, priv->response_headers); - priv->payload = g_memdup (message->response_body->data, message->response_body->length); + priv->payload = g_memdup (message->response_body->data, + message->response_body->length + 1); priv->length = message->response_body->length; priv->status_code = message->status_code; |