From 8f15940f50fbfb3954630ce8d026f3bc994b7764 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 29 Jun 2012 12:40:47 +0300 Subject: [PATCH] SFTP connections are shown now in 'Active VFS connections' list. Signed-off-by: Slava Zanko --- src/vfs/sftpfs/vfs_class.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/vfs/sftpfs/vfs_class.c b/src/vfs/sftpfs/vfs_class.c index cc5795861..892456331 100644 --- a/src/vfs/sftpfs/vfs_class.c +++ b/src/vfs/sftpfs/vfs_class.c @@ -634,6 +634,34 @@ sftpfs_cb_errno (struct vfs_class *me) return errno; } +/* --------------------------------------------------------------------------------------------- */ +/** + * Callback for fill_names VFS function. + * Add SFTP connections to the 'Active VFS connections' list + * + * @param me unused + * @param func callback function for adding SFTP-connection to list of active connections + */ + +static void +sftpfs_cb_fill_names (struct vfs_class *me, fill_names_f func) +{ + GList *iter; + + (void) me; + + for (iter = sftpfs_subclass.supers; iter != NULL; iter = g_list_next (iter)) + { + const struct vfs_s_super *super = (const struct vfs_s_super *) iter->data; + char *name; + + name = vfs_path_element_build_pretty_path_str (super->path_element); + + func (name); + g_free (name); + } +} + /* --------------------------------------------------------------------------------------------- */ /*** public functions ****************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -663,6 +691,8 @@ sftpfs_init_class_callbacks (void) sftpfs_class.init = sftpfs_cb_init; sftpfs_class.done = sftpfs_cb_done; + sftpfs_class.fill_names = sftpfs_cb_fill_names; + sftpfs_class.opendir = sftpfs_cb_opendir; sftpfs_class.readdir = sftpfs_cb_readdir; sftpfs_class.closedir = sftpfs_cb_closedir;