some rebuilding

This commit is contained in:
2025-07-25 22:59:26 +02:00
parent fb0a1644b7
commit 2e08a3093e
3 changed files with 46 additions and 7 deletions
+19
View File
@@ -7,6 +7,25 @@ pub async fn handle_request(
let mut rng: rand::prelude::ThreadRng = rand::thread_rng();
match buf[0] {
x if x == pea_2_pea::ServerMethods::QUERY as u8 => {
#[cfg(debug_assertions)]
eprintln!("QUERY method");
let client_sock_addr_str: String = src.to_string();
let mut send_vec: Vec<u8> = client_sock_addr_str.into();
send_vec.insert(0, pea_2_pea::ServerMethods::QUERY as u8);
match socket.send_to(&send_vec, &src) {
Ok(s) => {
#[cfg(debug_assertions)]
eprintln!("send {} bytes", s);
}
Err(e) => {
eprintln!("Error snding data: {}", e);
}
}
}
x if x == pea_2_pea::ServerMethods::GET as u8 => {
#[cfg(debug_assertions)]
println!("GET method");