Skip to content

Reset buffered input before reconnecting - #177

Open
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/reconnect-buffer-reset
Open

Reset buffered input before reconnecting#177
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/reconnect-buffer-reset

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem: A closed session retained partial packet bytes in its input buffer. Reopening the same session could parse those stale bytes as the start of the new connection's first packet.

Fix: Reset the buffered input together with the packet length and protocol state during reconnect.

Regression coverage: Adds a focused upstream reconnect case with stale buffered bytes. Session tests: 79 runs / 211 assertions. Full suite: 434 runs / 1,198 assertions with only the pre-existing Ruby 4 StartTest positional-hash/keyword expectation failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant