From 2ae18c34e2cf81d592e1b014cc59ad0890aec438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20=C3=89LIE?= Date: Sat, 9 Dec 2023 21:29:00 +0100 Subject: [PATCH] innd: Fix :bytes metadata for dot-stuffed headers Initial dots in header field names were counted whereas they shouldn't have. see #286 --- doc/pod/news.pod | 6 ++++++ innd/art.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/doc/pod/news.pod b/doc/pod/news.pod index 952a7112a..ebbfb970d 100644 --- a/doc/pod/news.pod +++ b/doc/pod/news.pod @@ -54,6 +54,12 @@ is not. Thanks to Enrik Berkhan for the patch for B. =item * +INN now properly handles header field names starting with a leading dot: +B 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 (in header-only mode with the B<-B> flag). diff --git a/innd/art.c b/innd/art.c index 127d2970e..be51e7bf1 100644 --- a/innd/art.c +++ b/innd/art.c @@ -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;