Skip to content

Fix body dot-stuffing for bare CR line endings - #213

Merged
enteriaza merged 2 commits into
masterfrom
168-bug-protocol-body-dot-stuffing-ignores-bare-cr-line-breaks
Oct 20, 2026
Merged

enteriaza merged 2 commits into
masterfrom
168-bug-protocol-body-dot-stuffing-ignores-bare-cr-line-breaks

Conversation

@enteriaza

Copy link
Copy Markdown
Collaborator

Summary

Closes #168

Fix body dot-stuffing so CR, LF, and CRLF are consistently recognized as line boundaries, matching the parser's existing line-accounting behavior.

Changes

  • Update ArticleBodyWireStuffer to recognize CR, LF, and CRLF when locating body line boundaries.
  • Ensure dot-leading lines following bare CR characters receive the required stuffing dot.
  • Handle consecutive CR bytes correctly when identifying subsequent line starts.
  • Add regression tests for the reported issue, mixed line endings, consecutive CR characters, and dot-leading body lines.
  • Verify the interaction between body materialization, wire stuffing, and frameability checks.
  • Update ArticleRecord.md to document the line-boundary behavior.

Validation

  • ArticleBodyWireStufferTests — 27 passed
  • Focused parser, materializer, framing, and stuffer tests — 171 passed
  • VectorNNTPD.Common.Tests — 957 passed
  • VectorNNTPD.BackFillerService.Tests — 1,266 passed
  • Release x64 solution build — 0 warnings, 0 errors
  • dotnet format --verify-no-changes — passed
  • Local CodeQL analysis — completed successfully, with no findings in the changed files

Compatibility and notes

The parser's existing admission behavior is unchanged. Bare CR and bare LF bodies may still be retained, but IsFrameable continues to require CRLF line endings for NNTP delivery. The wire stuffer detects line starts consistently without rewriting the original body bytes.

Local CodeQL results do not replace GitHub code scanning.

Recognize CR, LF, and CRLF as line boundaries when locating
dot-leading body lines, matching parser line accounting.
Add regression coverage for bare CR, LF, and repeated CR
without changing the exclusive-CRLF delivery requirement.
Use responsive servers in the never-firing replenish timer test
so it measures cancellation independently of stalled QUIT writes.
Retain explicit timer-armed synchronization and bounded cleanup.
@enteriaza enteriaza self-assigned this Oct 20, 2026
@enteriaza enteriaza added the bug Something isn't working label Oct 20, 2026
@enteriaza
enteriaza merged commit ba9d21d into master Oct 20, 2026
7 checks passed
@enteriaza
enteriaza deleted the 168-bug-protocol-body-dot-stuffing-ignores-bare-cr-line-breaks branch October 20, 2026 04:56
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] Body dot-stuffing ignores bare CR line breaks

1 participant