aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server.rs b/src/server.rs
index e60c054..4c590be 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -47,13 +47,14 @@ fn run_server(path: &str, is_recv: bool, recursive: bool) {
let (mut socket, _src) = listener.accept().unwrap();
println!("Got connection from {}", socket.peer_addr().unwrap());
+ let mut stream = socket.into();
if is_recv {
- common::receive_files(&mut socket, path, recursive);
+ common::sink_files(&mut stream, path, recursive);
} else {
- common::send_files(&mut socket, path, recursive);
+ common::source_files(&mut stream, path, recursive);
}
- socket.close().unwrap();
+ stream.close().unwrap();
}
fn usage_server(opts: Options) {