This commit is contained in:
PoliEcho 2025-08-01 16:16:00 +02:00
parent 07df839b6d
commit be37082b87

View File

@ -90,6 +90,11 @@ fn main() -> std::io::Result<()> {
Ok(s) => s, Ok(s) => s,
Err(e) => return Err(ServerErrorResponses::into_io_error(e)), Err(e) => return Err(ServerErrorResponses::into_io_error(e)),
}; };
println!(
"{} my bublic sockaddr: {}",
"[LOG]".blue(),
public_sock_addr_raw
);
let mut salt: [u8; BLOCK_SIZE] = [0u8; BLOCK_SIZE]; let mut salt: [u8; BLOCK_SIZE] = [0u8; BLOCK_SIZE];
let mut iv: [u8; BLOCK_SIZE] = [0u8; BLOCK_SIZE]; let mut iv: [u8; BLOCK_SIZE] = [0u8; BLOCK_SIZE];
@ -195,6 +200,7 @@ fn main() -> std::io::Result<()> {
let encrypted = network_write_lock.encrypted; let encrypted = network_write_lock.encrypted;
let key = network_write_lock.key; let key = network_write_lock.key;
network_write_lock.peers.iter_mut().for_each(|peer| { network_write_lock.peers.iter_mut().for_each(|peer| {
let mut retry_count: usize = 0;
loop { loop {
match net::P2P_query(&mut buf, &peer.sock_addr, &socket, encrypted, key) { match net::P2P_query(&mut buf, &peer.sock_addr, &socket, encrypted, key) {
Ok(ip) => { Ok(ip) => {
@ -202,12 +208,18 @@ fn main() -> std::io::Result<()> {
peer.private_ip = ip; peer.private_ip = ip;
break; break;
} }
Err(e) => eprintln!( Err(e) => {
"{} while getting ip from peer: {}, Error: {}, Retrying!", eprintln!(
"[ERROR]".red(), "{} while getting ip from peer: {}, Error: {}, Retrying!",
peer.sock_addr, "[ERROR]".red(),
e peer.sock_addr,
), e
);
retry_count += 1
}
}
if retry_count >= STANDARD_RETRY_MAX {
break;
} }
} }
}); });