summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2021-05-25 23:39:39 +0200
committercos <cos>2021-05-25 23:42:42 +0200
commit6360050f3697e33a39909740f23919863fb260e8 (patch)
tree2ef020c3d10435d3b0ad89ae7acf205206dec5bc
parenteff55df744de39394f5e3e96992347eaf95ed84c (diff)
downloadroughenough-rust_assistance.zip
Make roughenough-client code compilerust_assistance
-rw-r--r--src/bin/roughenough-client.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/roughenough-client.rs b/src/bin/roughenough-client.rs
index 4fe169d..92f9e34 100644
--- a/src/bin/roughenough-client.rs
+++ b/src/bin/roughenough-client.rs
@@ -60,12 +60,12 @@ fn receive_response(sock: &mut UdpSocket) -> RtMessage {
RtMessage::from_bytes(&buf[0..resp_len]).unwrap()
}
-fn process_response(resp: RtMessage, verbose: bool, json: bool, time_format: &str, pub_key: Option<Vec<u8>>, nonce: &[64], use_utc: bool) -> ! {
+fn process_response(resp: RtMessage, verbose: bool, json: bool, time_format: &str, pub_key: Option<Vec<u8>>, nonce: &[u8; 64], use_utc: bool) -> ! {
let ParsedResponse {
verified,
midpoint,
radius,
- } = ResponseHandler::new(pub_key.clone(), resp.clone(), nonce).extract_time();
+ } = ResponseHandler::new(pub_key.clone(), resp.clone(), *nonce).extract_time();
let map = resp.into_hash_map();
let index = map[&Tag::INDX]
@@ -100,6 +100,7 @@ fn process_response(resp: RtMessage, verbose: bool, json: bool, time_format: &st
} else {
println!("{}", out);
}
+ std::process::exit(0);
}
fn stress_test_forever(addr: &SocketAddr) -> ! {
@@ -359,7 +360,7 @@ fn main() {
for (nonce, _, mut socket) in requests {
let resp = receive_response(&mut socket);
- process_response(resp, verbose, json, time_format, pub_key, nonce, use_utc);
+ process_response(resp, verbose, json, time_format, pub_key, &nonce, use_utc);
}
}