summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2013-12-08 13:04:45 +0200
committerRoss Lagerwall <rosslagerwall@gmail.com>2013-12-08 13:15:57 +0200
commitfbcd75035e89c9431c9e1512e02e54ac8b5200d0 (patch)
tree19962ddb22e389174e50ea7c12bca0c9288d3a17
parent7e0f96133ca897640be51c3f4039dd90188357da (diff)
downloadgvfs-fbcd75035e89c9431c9e1512e02e54ac8b5200d0.tar.gz
http: Allow seek past end of file
Handle a read after a seek past the end of the file by ignoring the requested range not satisfiable http error (416) and simply returning 0. https://bugzilla.gnome.org/show_bug.cgi?id=710534
-rw-r--r--daemon/gvfshttpinputstream.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/gvfshttpinputstream.c b/daemon/gvfshttpinputstream.c
index 322d343f..f96f52db 100644
--- a/daemon/gvfshttpinputstream.c
+++ b/daemon/gvfshttpinputstream.c
@@ -338,6 +338,14 @@ read_send_callback (GObject *object,
}
if (!SOUP_STATUS_IS_SUCCESSFUL (priv->msg->status_code))
{
+ if (priv->msg->status_code == SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE)
+ {
+ g_input_stream_close (priv->stream, NULL, NULL);
+ g_task_return_int (task, 0);
+ g_clear_object (&priv->stream);
+ g_object_unref (task);
+ return;
+ }
g_task_return_new_error (task,
SOUP_HTTP_ERROR,
priv->msg->status_code,