B:BD[
3.298976] → [
3.298976:300296]
async fn test_compress(local: bool) {
env_logger::try_init().unwrap_or(());
let (client_key, addr) = if local {
let client_key = thrussh_keys::key::KeyPair::generate_ed25519().unwrap();
let client_pubkey = Arc::new(client_key.clone_public_key());
let mut config = super::server::Config::default();
config.preferred = super::Preferred::COMPRESSED;
config.auth_rejection_time = std::time::Duration::from_secs(0);
config.connection_timeout = None; // Some(std::time::Duration::from_secs(3));
config.auth_rejection_time = std::time::Duration::from_secs(3);
config
.keys
.push(thrussh_keys::key::KeyPair::generate_ed25519().unwrap());
let config = Arc::new(config);
let sh = Server {
client_pubkey,
clients: Arc::new(Mutex::new(HashMap::new())),
id: 0,
};
tokio::spawn(super::server::run(config, "0.0.0.0:2222", sh));
std::thread::sleep(std::time::Duration::from_millis(100));
(client_key, "127.0.0.1:2222")
} else {
let client_key = thrussh_keys::load_secret_key("id_ed25519", None).unwrap();
(client_key, "127.0.0.1:2222")
let client_key = thrussh_keys::key::KeyPair::generate_ed25519().unwrap();
let client_pubkey = Arc::new(client_key.clone_public_key());
let mut config = server::Config::default();
config.preferred = Preferred::COMPRESSED;
config.connection_timeout = None; // Some(std::time::Duration::from_secs(3));
config.auth_rejection_time = std::time::Duration::from_secs(3);
config
.keys
.push(thrussh_keys::key::KeyPair::generate_ed25519().unwrap());
let config = Arc::new(config);
let mut sh = Server {
client_pubkey,
clients: Arc::new(Mutex::new(HashMap::new())),
id: 0,