file system and file donload

This commit is contained in:
TIBERGHIEN corentin
2026-01-23 01:11:02 +01:00
parent 26fa7a833f
commit 31b26e96b0
7 changed files with 513 additions and 34 deletions

View File

@@ -434,6 +434,22 @@ pub fn parse_message(
None => {}
}
}
ROOTREQUEST => {
println!("root request received");
let _ = cmd_tx.send(NetworkEvent::RootRequest(ip.to_string()));
}
DATUMREQUEST => {
let received_length = u16::from_be_bytes(
received_message[TYPE..LENGTH]
.try_into()
.expect("incorrect size"),
);
let received_hash = &received_message[LENGTH..LENGTH + received_length as usize];
let _ = cmd_tx.send(NetworkEvent::DatumRequest(
received_hash.try_into().expect("incorrect size"),
ip.to_string(),
));
}
_ => return None,
};
constructed_message