Skip to content

Commit

Permalink
innd: Fix :bytes metadata for dot-stuffed headers
Browse files Browse the repository at this point in the history
Initial dots in header field names were counted whereas they shouldn't
have.

see #286
  • Loading branch information
Julien-Elie committed Dec 9, 2023
1 parent 541f672 commit 2ae18c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/pod/news.pod
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ is not. Thanks to Enrik Berkhan for the patch for B<nnrpd>.

=item *

INN now properly handles header field names starting with a leading dot:
B<innd> correctly computes the C<:bytes> metadata item of articles with such
header field names.

=item *

Fixed the computation of the Bytes header field by B<pullnews> (in header-only
mode with the B<-B> flag).

Expand Down
3 changes: 3 additions & 0 deletions innd/art.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ ARTparseheader(CHANNEL *cp)
ARTcheckheader(cp, i - data->CurHeader);
data->CurHeader = i;
}
/* Remember that the line begins with a dot. */
if (bp->data[i] == '.')
data->DotStuffedLines++;
}
if (bp->data[i] == '\r' && bp->data[i + 1] == '\n') {
cp->Next = i + 2;
Expand Down

0 comments on commit 2ae18c3

Please sign in to comment.