Skip to content

Commit ac4e882

Browse files
committed
fix: add the relay check to other methods
1 parent 07173b7 commit ac4e882

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,9 @@ async fn connect_tcp(args: ConnectTcpArgs) -> Result<()> {
501501
tracing::info!("tcp listening on {:?}", addrs);
502502

503503
// Wait for our own endpoint to be ready before trying to connect.
504-
endpoint.home_relay().initialized().await;
505-
504+
if args.common.relay != RelayModeOption::Disabled {
505+
endpoint.home_relay().initialized().await;
506+
}
506507
let tcp_listener = match tokio::net::TcpListener::bind(addrs.as_slice()).await {
507508
Ok(tcp_listener) => tcp_listener,
508509
Err(cause) => {
@@ -775,8 +776,9 @@ async fn connect_unix(args: ConnectUnixArgs) -> Result<()> {
775776
tracing::info!("unix listening on {:?}", socket_path);
776777

777778
// Wait for our own endpoint to be ready before trying to connect.
778-
endpoint.home_relay().initialized().await;
779-
779+
if args.common.relay != RelayModeOption::Disabled {
780+
endpoint.home_relay().initialized().await;
781+
}
780782
// Remove existing socket file if it exists
781783
if let Err(e) = tokio::fs::remove_file(&socket_path).await {
782784
if e.kind() != io::ErrorKind::NotFound {

0 commit comments

Comments
 (0)