Adds an optional timestamped trace of transfer-relevant events (tail position vs. file length, rename detection, finalize, protocol send/recv) to both the client and server sides, so a stalled transfer can be diagnosed from correlated local/remote logs instead of guessing. Notably logs when a source's final size ends up smaller than what was already read (pos > current_len after rename) -- this can never satisfy the pos == current_len finalize condition, which is a real deadlock risk for writers that preallocate a fixed-size file and truncate down to the actual capture length before renaming. --log <path> on either the client or `--server` process traces that process's own events. --log on ClientCli is local-only; --remote-log <path> is forwarded as the spawned --server process's --log so both sides of a remote transfer leave a trace, tied together by timestamp.
27 lines
550 B
Rust
27 lines
550 B
Rust
mod channel;
|
|
mod chunker;
|
|
mod cli;
|
|
mod client;
|
|
mod naming;
|
|
mod pipeline;
|
|
mod protocol;
|
|
mod server;
|
|
mod ssh;
|
|
mod tail;
|
|
mod tracelog;
|
|
mod zstd_frame;
|
|
|
|
use clap::Parser;
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
let mut args: Vec<String> = std::env::args().collect();
|
|
if args.get(1).map(|s| s.as_str()) == Some("--server") {
|
|
args.remove(1);
|
|
let server_cli = cli::ServerCli::parse_from(args);
|
|
server::run(server_cli)
|
|
} else {
|
|
let client_cli = cli::ClientCli::parse_from(args);
|
|
client::run(client_cli)
|
|
}
|
|
}
|