mirror of
https://github.com/wez/wezterm.git
synced 2024-12-29 16:42:13 +03:00
add some more diagnostics for mux connections
I suspect some race condition because adding these made the connect time hang stop reproducing for me on my local network. Will try this to the corp vpn. refs: https://github.com/wez/wezterm/issues/127
This commit is contained in:
parent
cb9ec2fa2a
commit
7257cf18c2
@ -128,8 +128,12 @@ fn client_thread(
|
||||
next_serial += 1;
|
||||
promises.insert(serial, promise);
|
||||
|
||||
pdu.encode(reconnectable.stream(), serial)?;
|
||||
reconnectable.stream().flush()?;
|
||||
pdu.encode(reconnectable.stream(), serial)
|
||||
.context("encoding a PDU to send to the server")?;
|
||||
reconnectable
|
||||
.stream()
|
||||
.flush()
|
||||
.context("flushing PDU to server")?;
|
||||
}
|
||||
},
|
||||
Err(TryRecvError::Empty) => break,
|
||||
@ -166,7 +170,8 @@ fn client_thread(
|
||||
Ok(Some(decoded)) => {
|
||||
log::trace!("decoded serial {}", decoded.serial);
|
||||
if decoded.serial == 0 {
|
||||
process_unilateral(local_domain_id, decoded)?;
|
||||
process_unilateral(local_domain_id, decoded)
|
||||
.context("processing unilateral PDU from server")?;
|
||||
} else if let Some(mut promise) = promises.remove(&decoded.serial) {
|
||||
promise.result(Ok(decoded.pdu));
|
||||
} else {
|
||||
@ -582,7 +587,7 @@ impl Reconnectable {
|
||||
.configure()?
|
||||
.verify_hostname(!tls_client.accept_invalid_hostnames);
|
||||
|
||||
ui.output_str(&format!("Connecting to {}\n", remote_address));
|
||||
ui.output_str(&format!("Connecting to {} using TLS\n", remote_address));
|
||||
let stream = TcpStream::connect(remote_address)
|
||||
.with_context(|| format!("connecting to {}", remote_address))?;
|
||||
stream.set_nodelay(true)?;
|
||||
@ -606,7 +611,7 @@ impl Reconnectable {
|
||||
)
|
||||
})?,
|
||||
);
|
||||
ui.output_str("Connected!\n");
|
||||
ui.output_str("TLS Connected!\n");
|
||||
self.stream.replace(stream);
|
||||
Ok(())
|
||||
}
|
||||
|
@ -302,9 +302,14 @@ impl Domain for ClientDomain {
|
||||
}
|
||||
};
|
||||
|
||||
ui.output_str("Version check OK! Requesting tab list...\n");
|
||||
let tabs = client.list_tabs().await?;
|
||||
|
||||
ui.output_str(&format!(
|
||||
"Server has {} tabs. Attaching to local UI...\n",
|
||||
tabs.tabs.len()
|
||||
));
|
||||
ClientDomain::finish_attach(domain_id, client, tabs)?;
|
||||
ui.output_str("Attached!\n");
|
||||
drop(activity);
|
||||
ui.close();
|
||||
Ok(())
|
||||
|
@ -63,11 +63,11 @@ pub fn ssh_connect_with_ui(
|
||||
}
|
||||
};
|
||||
|
||||
ui.output_str(&format!("Connecting to {}\n", remote_address));
|
||||
ui.output_str(&format!("Connecting to {} using SSH\n", remote_address));
|
||||
|
||||
let tcp = TcpStream::connect(&remote_address)
|
||||
.with_context(|| format!("ssh connecting to {}", remote_address))?;
|
||||
ui.output_str("Connected OK!\n");
|
||||
ui.output_str("SSH: Connected OK!\n");
|
||||
tcp.set_nodelay(true)?;
|
||||
sess.set_tcp_stream(tcp);
|
||||
sess.handshake()
|
||||
@ -185,7 +185,7 @@ pub fn ssh_connect_with_ui(
|
||||
"Password authentication for {}@{}\n",
|
||||
username, remote_address
|
||||
));
|
||||
let pass = ui.password("Password: ")?;
|
||||
let pass = ui.password("🔐 Password: ")?;
|
||||
if let Err(err) = sess.userauth_password(username, &pass) {
|
||||
log::error!("while attempting password auth: {}", err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user