gvfs r1711 - in branches/gnome-2-22: . daemon



Author: alexl
Date: Mon Mar 31 13:59:54 2008
New Revision: 1711
URL: http://svn.gnome.org/viewvc/gvfs?rev=1711&view=rev

Log:
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.



Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/daemon/gvfsbackendsftp.c

Modified: branches/gnome-2-22/daemon/gvfsbackendsftp.c
==============================================================================
--- branches/gnome-2-22/daemon/gvfsbackendsftp.c	(original)
+++ branches/gnome-2-22/daemon/gvfsbackendsftp.c	Mon Mar 31 13:59:54 2008
@@ -452,6 +452,16 @@
   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 @@
   
   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 @@
 {
   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);
 



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