From 25f9abeb4c69024f8d9dceb472ba33c03e00daa0 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 22:36:07 +0100 Subject: v0.2.5: fix terminal width, ping timing and output formatting --- src/bin/client/connection.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/bin/client/connection.rs') diff --git a/src/bin/client/connection.rs b/src/bin/client/connection.rs index e54b646..93a7829 100644 --- a/src/bin/client/connection.rs +++ b/src/bin/client/connection.rs @@ -1,4 +1,5 @@ use zagan_bet::client::database; +use zagan_bet::client::ui::first_contact_lines; use crate::tls::TlsConnector; use rusqlite::Connection; use std::io::{Read, Write}; @@ -57,10 +58,9 @@ pub fn connect( if let Some(fp) = observed { if database::get_fingerprint(conn, addr).is_none() { database::save_fingerprint(conn, addr, &fp)?; - println!( - "First contact with {addr}: trusting fingerprint {fp}\n\ - Future connections must present the same certificate key." - ); + for line in first_contact_lines(addr, &fp) { + println!("{}", line); + } } } } @@ -72,7 +72,11 @@ pub fn connect( let mut response = String::new(); tls.read_line(&mut response)?; let elapsed = start.elapsed(); - println!("\n\rConnected to {} with ping delay: {:?} (TLS)", addr, elapsed); + println!( + "\n\rConnected to {} with ping delay: {:.1}ms (TLS)", + addr, + elapsed.as_secs_f64() * 1000.0 + ); if let Some((username, password)) = database::get_credentials(conn, addr) { let auth_msg = format!("AUTH {} {}", username, password); -- cgit v1.2.3