ping deadlock
This commit is contained in:
@@ -134,6 +134,7 @@ pub fn parse_message(
|
||||
match msgtype {
|
||||
HELLO | HELLOREPLY => {
|
||||
let ilength = u16::from_be_bytes(length_bytes);
|
||||
println!("hello");
|
||||
println!("name received length: {}", ilength);
|
||||
let received_name = &received_message[LENGTH + EXTENSIONS..LENGTH + ilength as usize];
|
||||
let received_username = String::from_utf8(received_name.to_vec());
|
||||
@@ -147,12 +148,14 @@ pub fn parse_message(
|
||||
.block_on(get_peer_key(&username))
|
||||
.expect("failed to retrieve public key"),
|
||||
};
|
||||
println!("handshake JULIUS added");
|
||||
handhsake_history.add_new_handshake(peer_pubkey, "".to_string(), ip);
|
||||
let signature: [u8; SIGNATURE] = received_message
|
||||
[LENGTH + msg_length..LENGTH + msg_length + SIGNATURE]
|
||||
.try_into()
|
||||
.expect("Taille incorrecte");
|
||||
match msgtype {
|
||||
HELLOREPLY => {
|
||||
handhsake_history.add_new_handshake(peer_pubkey, "".to_string(), ip);
|
||||
}
|
||||
_ => {
|
||||
println!("no handshake added");
|
||||
}
|
||||
}
|
||||
if !verify_signature(peer_pubkey, &received_message) {
|
||||
println!(
|
||||
"incorrect signature from given peer: {}, ignoring message of type {} with id {}",
|
||||
|
||||
Reference in New Issue
Block a user