style: handshake_recv

This commit is contained in:
Ahmet Kaan GÜMÜŞ 2023-10-14 00:33:18 +03:00
parent 87511f184a
commit 475010542c

View file

@ -205,13 +205,14 @@ impl FileInfo
{ {
match self.recv_until(stream, '\n') match self.recv_until(stream, '\n')
{ {
Some(handshake) => Some(mut handshake) =>
{ {
// try then commit
println!("Done: Handshake -> {}", self.location); println!("Done: Handshake -> {}", self.location);
let mut handshake_terminated = handshake.clone(); let size = String::from_utf8(handshake.clone()).unwrap().parse().unwrap();
handshake_terminated.push(b'\n'); handshake.push(b'\n');
self.send_exact(handshake_terminated.as_slice(), stream); self.send_exact(&handshake.as_slice(), stream);
String::from_utf8(handshake.clone()).unwrap().parse().unwrap() size
} }
None => None =>
{ {