[gvfs] sftp: Add a data connection



commit 48de715624f73d36748c7d8136a0ddcf2110b1b0
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Mon May 25 11:54:13 2015 +0100

    sftp: Add a data connection
    
    Add a data connection in addition to the command connection currently
    used.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747128

 daemon/gvfsbackendsftp.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index cbdd1da..1ccf8d2 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -203,6 +203,7 @@ struct _GVfsBackendSftp
   guint32 current_id;
 
   Connection command_connection;
+  Connection data_connection;
 
   GMountSource *mount_source; /* Only used/set during mount */
   int mount_try;
@@ -292,6 +293,7 @@ g_vfs_backend_sftp_finalize (GObject *object)
 
   backend = G_VFS_BACKEND_SFTP (object);
   destroy_connection (&backend->command_connection);
+  destroy_connection (&backend->data_connection);
 
   if (G_OBJECT_CLASS (g_vfs_backend_sftp_parent_class)->finalize)
     (*G_OBJECT_CLASS (g_vfs_backend_sftp_parent_class)->finalize) (object);
@@ -311,6 +313,10 @@ g_vfs_backend_sftp_init (GVfsBackendSftp *backend)
                                                                         NULL,
                                                                         NULL,
                                                                         (GDestroyNotify)expected_reply_free);
+  backend->data_connection.expected_replies = g_hash_table_new_full (NULL,
+                                                                     NULL,
+                                                                     NULL,
+                                                                     (GDestroyNotify)expected_reply_free);
 }
 
 static void
@@ -1297,6 +1303,7 @@ static void
 fail_jobs_and_unmount (GVfsBackendSftp *backend, GError *error)
 {
   fail_jobs (&backend->command_connection, error);
+  fail_jobs (&backend->data_connection, error);
 
   g_error_free (error);
 
@@ -1968,6 +1975,9 @@ try_unmount (GVfsBackend *backend,
   if (op_backend->command_connection.reply_stream &&
       op_backend->command_connection.reply_stream_cancellable)
     g_cancellable_cancel (op_backend->command_connection.reply_stream_cancellable);
+  if (op_backend->data_connection.reply_stream &&
+      op_backend->data_connection.reply_stream_cancellable)
+    g_cancellable_cancel (op_backend->data_connection.reply_stream_cancellable);
   g_vfs_job_succeeded (G_VFS_JOB (job));
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]