summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-03-31 12:59:32 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-03-31 12:59:32 +0000
commite27e962a99a24ee21800cf64555fe2c19e516e96 (patch)
tree3743a75327c7d8f2ebbe58aecb7dd6afff41fb4a
parent86f81fb7eb4b042844a6e33c97a2a5b4ab413dd3 (diff)
downloadgvfs-e27e962a99a24ee21800cf64555fe2c19e516e96.tar.gz
Get the right size of the command messages. Actually send file attributes
2008-03-31 Alexander Larsson <alexl@redhat.com> * daemon/gvfsbackendsftp.c: Get the right size of the command messages. Actually send file attributes in mkdir request. svn path=/trunk/; revision=1710
-rw-r--r--ChangeLog6
-rw-r--r--daemon/gvfsbackendsftp.c16
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 288f5bc9..a20a6838 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-31 Alexander Larsson <alexl@redhat.com>
+
+ * daemon/gvfsbackendsftp.c:
+ Get the right size of the command messages.
+ Actually send file attributes in mkdir request.
+
2008-03-31 Christian Kellner <gicmo@gnome.org>
* daemon/gvfsbackendsftp.c: Make sure we send (error)
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 9d897b37..2ce4aabb 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -452,6 +452,16 @@ new_command_stream (GVfsBackendSftp *backend, int type)
return data_stream;
}
+static gsize
+get_data_size (GMemoryOutputStream *stream)
+{
+ g_seekable_seek (G_SEEKABLE (stream),
+ 0,
+ G_SEEK_END,
+ NULL, NULL);
+ return g_seekable_tell (G_SEEKABLE (stream));
+}
+
static gpointer
get_data_from_command_stream (GDataOutputStream *command_stream, gsize *len)
{
@@ -461,7 +471,7 @@ get_data_from_command_stream (GDataOutputStream *command_stream, gsize *len)
mem_stream = g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (command_stream));
data = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (mem_stream));
- *len = g_memory_output_stream_get_size (G_MEMORY_OUTPUT_STREAM (mem_stream));
+ *len = get_data_size (G_MEMORY_OUTPUT_STREAM (mem_stream));
len_ptr = (guint32 *)data;
*len_ptr = GUINT32_TO_BE (*len - 4);
@@ -3681,10 +3691,12 @@ try_make_directory (GVfsBackend *backend,
{
GVfsBackendSftp *op_backend = G_VFS_BACKEND_SFTP (backend);
GDataOutputStream *command;
-
+
command = new_command_stream (op_backend,
SSH_FXP_MKDIR);
put_string (command, filename);
+ /* No file info - flag 0 */
+ g_data_output_stream_put_uint32 (command, 0, NULL, NULL);
queue_command_stream_and_free (op_backend, command, make_directory_reply, G_VFS_JOB (job), NULL);