file system and file donload
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user