New agent who dis #3

Merged
eric merged 5 commits from new-agent-who-dis into master 2026-11-16 16:05:25 +00:00
Owner

General bugfixes and hardening

General bugfixes and hardening
eric added 5 commits 2026-11-16 16:04:59 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copying a capture into its own directory resolved the destination to the
source's own path: a growing cap.pcap.partial was truncated to zero when
the receiver opened its in-flight file, and a finished capture was
silently replaced by its (possibly filtered) copy. Compare the source and
its final name against both destination paths by inode, or by canonical
parent + name for files that don't exist yet, and bail before anything
is opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--chunk 0 made every chunk 'full' while empty, so the chunker emitted
empty chunks (and empty zstd frames) forever -- 11 MB in 3 s from a
424-byte source. parse_size now returns NonZeroUsize, which flows through
SendOptions into RecordAlignedChunker, so a zero target can't reach the
cut logic. parse_size and parse_duration also use checked_mul instead of
wrapping on absurd inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a send failed, run_send joined the reader thread, but the reader
only learned the receiver was gone on its next send. An idle growing
capture, or a filter matching nothing, never produced one, so the
process hung -- locally, and as an orphaned remote --send server. The
reader now checks a stop flag every poll, raised once the send loop
ends. The client also kills ssh when a remote-to-local receive fails
locally rather than waiting on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file already sitting at the final name -- an earlier capture reusing
the name, or a previous copy -- counted as the rename the moment tailing
started, so the first writer lull longer than the grace period finalized
the transfer short. Treat the rename as observed only once the final path
is the same inode as the fd being tailed, which also still works when the
writer renames over such a leftover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eric merged commit bb67bbafa1 into master 2026-11-16 16:05:25 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eric/scpcap#3