aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/file_manager.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2019-08-29 00:44:59 +0200
committerGitHub <noreply@github.com>2019-08-29 00:44:59 +0200
commit9f613d5812f1893481f06d3806ef4f03048df2b8 (patch)
treed8d63db8c3cef6d3616fb78be0c50d40673b0d6e /libdino/src/service/file_manager.vala
parentf0c2ce0047debe75565877f5033ccdccfbd4b755 (diff)
parent6028fd15a81a084b63311bc61f7b48d9f3d00746 (diff)
downloaddino-9f613d5812f1893481f06d3806ef4f03048df2b8.tar.gz
dino-9f613d5812f1893481f06d3806ef4f03048df2b8.zip
Merge pull request #592 from hrxi/gsoc_1
Add SOCKS5 bytestreams and a couple of other fixes
Diffstat (limited to 'libdino/src/service/file_manager.vala')
-rw-r--r--libdino/src/service/file_manager.vala6
1 files changed, 2 insertions, 4 deletions
diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala
index c4a9a393..e0a417ee 100644
--- a/libdino/src/service/file_manager.vala
+++ b/libdino/src/service/file_manager.vala
@@ -269,8 +269,7 @@ public class FileManager : StreamInteractionModule, Object {
}
OutputStream os = file.create(FileCreateFlags.REPLACE_DESTINATION);
- yield os.splice_async(input_stream, 0);
- os.close();
+ yield os.splice_async(input_stream, OutputStreamSpliceFlags.CLOSE_SOURCE|OutputStreamSpliceFlags.CLOSE_TARGET);
file_transfer.size = (int)file_meta.size;
file_transfer.file_name = file_meta.file_name;
file_transfer.path = file.get_basename();
@@ -327,8 +326,7 @@ public class FileManager : StreamInteractionModule, Object {
string filename = Random.next_int().to_string("%x") + "_" + file_transfer.file_name;
File file = File.new_for_path(Path.build_filename(get_storage_dir(), filename));
OutputStream os = file.create(FileCreateFlags.REPLACE_DESTINATION);
- yield os.splice_async(file_transfer.input_stream, 0);
- os.close();
+ yield os.splice_async(file_transfer.input_stream, OutputStreamSpliceFlags.CLOSE_SOURCE|OutputStreamSpliceFlags.CLOSE_TARGET);
file_transfer.state = FileTransfer.State.COMPLETE;
file_transfer.path = filename;
file_transfer.input_stream = yield file.read_async();