style: handshake_recv
This commit is contained in:
parent
87511f184a
commit
475010542c
1 changed files with 6 additions and 5 deletions
11
src/main.rs
11
src/main.rs
|
@ -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 =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue