summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2010-02-19 17:05:31 +0100
committerTomas Bzatek <tbzatek@redhat.com>2010-02-19 17:05:31 +0100
commit58dcf9fb5d25f292cc4c99b51c4263b2e23241be (patch)
treefa4ed121db5988634b30979940c79a9f14aa4ac0
parentd2d9ec2d7144c6b41788f79cd5da390e46f49232 (diff)
downloadgvfs-58dcf9fb5d25f292cc4c99b51c4263b2e23241be.tar.gz
ftp: GVfsJobPull: perform any cache lookups before opening data connection
After the delete op, cache was invalidated and an attempt was made to retrieve file size in do_pull() while data connection was already opened. This patch only moves all necessary operations before setting up actual data stream for download. Fixes bug 610395
-rw-r--r--daemon/gvfsbackendftp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index cf33d107..99aaef8d 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1398,6 +1398,16 @@ do_pull (GVfsBackend * backend,
src = g_vfs_ftp_file_new_from_gvfs (ftp, source);
dest = g_file_new_for_path (local_path);
+ if (progress_callback)
+ {
+ GFileInfo *info = g_vfs_ftp_dir_cache_lookup_file (ftp->dir_cache, &task, src, TRUE);
+ if (info)
+ {
+ total_size = g_file_info_get_size (info);
+ g_object_unref (info);
+ }
+ }
+
g_vfs_ftp_task_setup_data_connection (&task);
g_vfs_ftp_task_send_and_check (&task,
G_VFS_FTP_PASS_100 | G_VFS_FTP_FAIL_200,
@@ -1431,16 +1441,6 @@ do_pull (GVfsBackend * backend,
goto out;
}
- if (progress_callback)
- {
- GFileInfo *info = g_vfs_ftp_dir_cache_lookup_file (ftp->dir_cache, &task, src, TRUE);
- if (info)
- {
- total_size = g_file_info_get_size (info);
- g_object_unref (info);
- }
- }
-
input = g_io_stream_get_input_stream (g_vfs_ftp_connection_get_data_stream (task.conn));
ftp_output_stream_splice (output,
input,