Skip to content

Add regression coverage for split-CRLF NNTP terminators - #207

Merged
enteriaza merged 1 commit into
masterfrom
162-bug-protocol-split-crlf-hides-the-nntp-multiline-terminator
Oct 19, 2026
Merged

enteriaza merged 1 commit into
masterfrom
162-bug-protocol-split-crlf-hides-the-nntp-multiline-terminator

Conversation

@enteriaza

Copy link
Copy Markdown
Collaborator

Summary

Add regression coverage for issue #162, which concerns an NNTP multiline terminator split across a CRLF read boundary.

The existing NntpStreamReader already handles a trailing CR correctly when the LF arrives in a subsequent read. This change locks that behavior in with deterministic tests. No production code was modified.

Closes #162

Changes

  • Add Split_crlf_multiline_terminator_is_a_single_dot to NntpStatusLineTests.
  • Use ChunkedStream to control read boundaries deterministically, including splitting the terminator between .\r and \n.
  • Verify that:
    • An unsplit or split .\r\n is returned as exactly . and recognized by IsMultilineTerminator.
    • The status reader correctly handles subsequent lines after the terminator.
    • Ordinary lines split across CRLF boundaries are normalized correctly.
    • A CR followed by ordinary data remains part of the line rather than being incorrectly stripped.
    • EOF after an incomplete terminator does not produce a false terminator.
    • A multiline capabilities response ends correctly when its terminator is split across reads.
  • Preserve existing line-reader, cancellation, EOF, and line-length behavior.

Validation

  • Focused NntpStatusLineTests: 13 passed, 0 failed, 0 skipped
  • Full BackFillerService test suite: 1,261 passed, 0 failed, 0 skipped
  • Release x64 solution build: 0 warnings, 0 errors
  • Solution format verification: passed

Regression verification

Temporarily disabling the existing pending-CR handling caused the new regression test to fail as expected: the split terminator was returned with length 2 instead of 1. The existing handling was restored before the full test suite was run.

Scope

Test-only change in tests/VectorNNTPD.BackFillerService.Tests/Nntp/NntpStatusLineTests.cs. No production protocol logic was changed.

Fixes #162

Cover the CRLF read boundary that could cause a multiline
terminator to be returned with a trailing carriage return.
Verify the terminator and subsequent status line are handled
correctly without changing production code.
@enteriaza enteriaza self-assigned this Oct 19, 2026
@enteriaza enteriaza added the bug Something isn't working label Oct 19, 2026
@enteriaza
enteriaza merged commit 950c9a5 into master Oct 19, 2026
7 checks passed
@enteriaza
enteriaza deleted the 162-bug-protocol-split-crlf-hides-the-nntp-multiline-terminator branch October 19, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug: Protocol] Split CRLF hides the NNTP multiline terminator

1 participant