carre
This commit is contained in:
BIN
Download/12.text
BIN
Download/12.text
Binary file not shown.
BIN
Download/13.text
BIN
Download/13.text
Binary file not shown.
BIN
Download/README
BIN
Download/README
Binary file not shown.
@@ -314,7 +314,7 @@ pub fn parse_message(
|
||||
|
||||
ERROR => {
|
||||
if let Ok(err_received) =
|
||||
String::from_utf8(received_message[LENGTH..(msg_length + LENGTH)].to_vec())
|
||||
String::from_utf8(received_message[LENGTH..(msg_length + LENGTH + 4)].to_vec())
|
||||
{
|
||||
let err_msg = format!("Error received from peer {} : {}", ip, err_received);
|
||||
let _ = cmd_tx_clone.send(NetworkEvent::Error(err_msg));
|
||||
|
||||
@@ -66,7 +66,6 @@ pub async fn perform_handshake(
|
||||
match server_addr_query.await {
|
||||
Some(sockaddr_bytes) => {
|
||||
sd.set_servername(username);
|
||||
sd.set_serveraddress(sockaddr_bytes.to_string());
|
||||
// first: &SocketAddr
|
||||
let mut payload = Vec::new();
|
||||
payload.extend_from_slice(&0u32.to_be_bytes());
|
||||
@@ -74,6 +73,7 @@ pub async fn perform_handshake(
|
||||
let hello_handshake = construct_message(1, payload, id, crypto_pair);
|
||||
if is_server_handshake {
|
||||
sd.add_message(id, EventType::Hello);
|
||||
sd.set_serveraddress(sockaddr_bytes.to_string());
|
||||
} else {
|
||||
sd.add_message(id, EventType::HelloThenRootRequest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user