diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-02-26 19:59:56 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-02-26 19:59:56 +0000 |
commit | e7a269a3602d1e4d1d44afc3159c456b91a339ea (patch) | |
tree | 61748bb52c40642598ad6fe4676226ccb5da3602 /daemon/gvfsbackendsftp.c | |
parent | 8a8ad31af3229f981202ef48343896042971f5fc (diff) | |
download | gvfs-e7a269a3602d1e4d1d44afc3159c456b91a339ea.tar.gz |
Bug 570977 – sftp backend sends trailing zeros to communication data
2009-02-26 Alexander Larsson <alexl@redhat.com>
Bug 570977 – sftp backend sends trailing zeros to communication data
* daemon/gvfsbackendsftp.c (get_data_from_command_stream):
Use g_memory_output_stream_get_data_size instead of old
workaround.
Patch from Pekka Vuorela
svn path=/trunk/; revision=2255
Diffstat (limited to 'daemon/gvfsbackendsftp.c')
-rw-r--r-- | daemon/gvfsbackendsftp.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c index 3c8908b5..3e535528 100644 --- a/daemon/gvfsbackendsftp.c +++ b/daemon/gvfsbackendsftp.c @@ -459,16 +459,6 @@ 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) { @@ -477,8 +467,8 @@ get_data_from_command_stream (GDataOutputStream *command_stream, gsize *len) guint32 *len_ptr; mem_stream = g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (command_stream)); + *len = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (mem_stream)); data = g_memory_output_stream_get_data (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); |