diff options
author | cos <cos> | 2021-05-25 23:39:39 +0200 |
---|---|---|
committer | cos <cos> | 2021-05-25 23:42:42 +0200 |
commit | 6360050f3697e33a39909740f23919863fb260e8 (patch) | |
tree | 2ef020c3d10435d3b0ad89ae7acf205206dec5bc | |
parent | eff55df744de39394f5e3e96992347eaf95ed84c (diff) | |
download | roughenough-rust_assistance.zip |
Make roughenough-client code compilerust_assistance
-rw-r--r-- | src/bin/roughenough-client.rs | 7 |
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); } } |