Fixed do_read() 'offset' corruption.
authorshort <>
Tue, 2 Sep 2003 22:10:29 +0000 (22:10 +0000)
committershort <>
Tue, 2 Sep 2003 22:10:29 +0000 (22:10 +0000)
modules/http-method.c

index 5d4ee1e..cc40202 100644 (file)
@@ -1917,7 +1917,9 @@ GnomeVFSResult result;
        if (handle->offset != handle->socket_buffer_offset) {
                GnomeVFSURI *uri = handle->uri;
                gchar *extra_headers;
+               GnomeVFSFileOffset offset_save;
 
+               offset_save = handle->offset;
                gnome_vfs_uri_ref(uri);
                http_handle_close (handle, context);
                extra_headers = g_strdup_printf("Range: bytes=%" G_GINT64_FORMAT "-\r\n",(gint64)handle->offset);
@@ -1925,6 +1927,7 @@ GnomeVFSResult result;
                                       context);
                g_free (extra_headers);
                gnome_vfs_uri_unref(uri);
+               handle->offset = offset_save;
                if (result != GNOME_VFS_OK) {
                        /* FIXME: 'method_handle' is now broken! */
                        memset(handle, 0, sizeof (*handle));