summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 15:08:28 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 15:08:28 +0000
commit1faab1adb49c8d9f33b54d1ac4efd25292eb3c55 (patch)
tree5e32a1f908da95c21410575e6e1aa127a5046b2d /daemon
parent451768de012fd96a2c53fc81db61a2fd3c6eca56 (diff)
downloadgvfs-1faab1adb49c8d9f33b54d1ac4efd25292eb3c55.tar.gz
Fix broken symlinks for readdir
Original git commit by Alexander Larsson <alexl@redhat.com> at 1189517069 +0200 svn path=/trunk/; revision=932
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackendsftp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 6b74b5a0..ee51c001 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -1370,7 +1370,6 @@ parse_attributes (GVfsBackendSftp *backend,
typedef struct {
DataBuffer *handle;
- GHashTable *get_symlink_hash;
int outstanding_requests;
} ReadDirData;
@@ -1390,11 +1389,13 @@ read_dir_symlink_reply (GVfsBackendSftp *backend,
GVfsJob *job,
gpointer user_data)
{
- char *name;
+ const char *name;
GFileInfo *info;
+ GFileInfo *lstat_info;
ReadDirData *data;
- name = user_data;
+ lstat_info = user_data;
+ name = g_file_info_get_name (lstat_info);
data = job->backend_data;
if (reply_type == SSH_FXP_ATTRS)
@@ -1409,10 +1410,12 @@ read_dir_symlink_reply (GVfsBackendSftp *backend,
g_object_unref (info);
}
+ else
+ g_vfs_job_enumerate_add_info (G_VFS_JOB_ENUMERATE (job), lstat_info);
- g_free (name);
- data->outstanding_requests --;
+ g_object_unref (lstat_info);
+ data->outstanding_requests--;
if (data->outstanding_requests == 0)
g_vfs_job_enumerate_done (G_VFS_JOB_ENUMERATE (job));
}
@@ -1477,9 +1480,7 @@ read_dir_reply (GVfsBackendSftp *backend,
put_string (command, abs_name);
g_free (abs_name);
- queue_command_stream_and_free (backend, command, id, read_dir_symlink_reply, G_VFS_JOB (job), name);
-
- name = NULL; /* Owned by get_info_symlink_reply */
+ queue_command_stream_and_free (backend, command, id, read_dir_symlink_reply, G_VFS_JOB (job), g_object_ref (info));
data->outstanding_requests ++;
}
else if (strcmp (".", name) != 0 &&