Skip to content

Commit 60e1163

Browse files
committed
Update tracing messages when --recv-only is used
1 parent b8aef96 commit 60e1163

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,11 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> {
330330
r.read_exact(&mut buf).await.e()?;
331331
snafu::ensure_whatever!(buf == dumbpipe::HANDSHAKE, "invalid handshake");
332332
}
333-
tracing::info!("forwarding stdin/stdout to {}", remote_node_id);
334333
if args.recv_only {
334+
tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_node_id);
335335
forward_bidi(tokio::io::empty(), tokio::io::stdout(), r, s).await?;
336336
} else {
337+
tracing::info!("forwarding stdin/stdout to {}", remote_node_id);
337338
forward_bidi(tokio::io::stdin(), tokio::io::stdout(), r, s).await?;
338339
}
339340
// stop accepting connections after the first successful one
@@ -368,10 +369,11 @@ async fn connect_stdio(args: ConnectArgs) -> Result<()> {
368369
// on stdin, so just write a handshake.
369370
s.write_all(&dumbpipe::HANDSHAKE).await.e()?;
370371
}
371-
tracing::info!("forwarding stdin/stdout to {}", remote_node_id);
372372
if args.recv_only {
373+
tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_node_id);
373374
forward_bidi(tokio::io::empty(), tokio::io::stdout(), r, s).await?;
374375
} else {
376+
tracing::info!("forwarding stdin/stdout to {}", remote_node_id);
375377
forward_bidi(tokio::io::stdin(), tokio::io::stdout(), r, s).await?;
376378
}
377379
tokio::io::stdout().flush().await.e()?;

0 commit comments

Comments
 (0)