Article View: news.software.nntp
Article #82711Re: unrelated possible bug with C flag?
From: D. Stussy
Date: Sun, 31 Jan 2010 07:46
Date: Sun, 31 Jan 2010 07:46
131 lines
5924 bytes
5924 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:hk23qr$dok$1@news.trigofacile.com...
> > I thought that's what I did in my proposal earlier....
> >
> > i = number of groups, NOT number of commas. Therefore poster => i=1.
>
> Then the (complete) patch is the following:
Your patch is still wrong. From the loop, variable "i" should be able to
assume the value of zero if the data field of the "Followup-To:" header is
empty or not specified.
Look at my solution. It accounts for that possibility.
> Index: include/inn/libinn.h
> ===================================================================
> --- include/inn/libinn.h (révision 8880)
> +++ include/inn/libinn.h (copie de travail)
> @@ -157,6 +157,7 @@
> extern bool IsValidMessageID(const char *string, bool
stripspaces);
> extern bool IsValidHeaderName(const char *string);
> extern const char * skip_cfws(const char *p);
> +extern const char * skip_fws(const char *p);
> extern void HeaderCleanFrom(char *from);
> extern struct _DDHANDLE * DDstart(FILE *FromServer, FILE *ToServer);
> extern void DDcheck(struct _DDHANDLE *h, char *group);
> Index: innd/art.c
> ===================================================================
> --- innd/art.c (révision 8911)
> +++ innd/art.c (copie de travail)
> @@ -2159,13 +2159,25 @@
> }
>
> if (HDR_FOUND(HDR__FOLLOWUPTO)) {
> - for (i = 0, p = HDR(HDR__FOLLOWUPTO) ; (p = strchr(p, ',')) != NULL
;
> - i++, p++)
> - continue;
> + for (i = 1, p = HDR(HDR__FOLLOWUPTO) ; (p = strchr(p, ',')) != NULL
;
> + i++, p++) ;
> +
> data->Followcount = i;
> +
> + /* When "poster" is the only value, then it is not a followup. */
> + if (i == 1) {
> + /* Skip leading whitespaces. */
> + p = (char *) skip_fws(HDR(HDR__FOLLOWUPTO));
> +
> + if (strncasecmp(p, "poster", 6) == 0
> + && (p[6] == ' ' || p[6] == '\t' || p[6] == '\0'
> + || p[6] == '\r' || p[6] == '\n')) {
> + data->Followcount = 0;
> + }
> + }
> + } else {
> + data->Followcount = data->Groupcount;
> }
> - if (data->Followcount == 0)
> - data->Followcount = data->Groupcount;
>
> groups = data->Newsgroups.List;
> /* Parse the Control header. */
> Index: lib/headers.c
> ===================================================================
> --- lib/headers.c (révision 8880)
> +++ lib/headers.c (copie de travail)
> @@ -86,3 +86,32 @@
> }
> return p;
> }
> +
> +
> +/*
> +** Skip any amount of FWS (folding whitespace), the RFC 5322 grammar
term
> +** for whitespace and CRLF pairs. We also allow simple newlines since
we don't
> +** always deal with wire-format messages. Note that we do not attempt
to
> +** ensure that CRLF or a newline is followed by whitespace. Returns
the new
> +** position of the pointer.
> +*/
> +const char *
> +skip_fws(const char *p)
> +{
> + for (; *p != '\0'; p++) {
> + switch (*p) {
> + case ' ':
> + case '\t':
> + case '\n':
> + break;
> + case '\r':
> + if (p[1] != '\n')
> + return p;
> + break;
> + default:
> + return p;
> + }
> + }
> + return p;
> +}
> +
>
>
>
> >>> Why did we accept such an article to begin with?
> >>
> >> Because not all injecting agents enforce such rules.
> >> Not all injecting agents are (and probably will be) compliant with RFC
5537.
> >
> > Did RFC 1036 say differently? If not, then these have been errors for
22
> > years.
>
> RFC 1036 did not go as deep as RFC 5537 does regarding the duties of
> all the agents involved in Netnews. In particular here, the injecting
agents.
>
> --
> Julien ÉLIE
>
> « Les mathématiques peuvent être définies comme une science
> dans laquelle on ne sait jamais de quoi on parle, ni si ce qu'on dit
> est vrai. » (Bertrand Russell)
>
Technical Details
Message-ID:
<hk3cgr$662$1@snarked.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!news.snarked.org!not-for-mailReferences:
<hic74m$vi8$1@news.trigofacile.com> <hicf9f$ntj$1@snarked.org> <hiclo9$dd4$1@news.trigofacile.com> <hidmvp$vh1$1@snarked.org> <hitipd$rtb$1@news.trigofacile.com> <hiu2ar$707$1@snarked.org> <hiun2p$2mt$1@news.trigofacile.com> <hj0m9c$g98$1@snarked.org> <hj7qh0$ggu$1@news.trigofacile.com> <hj8csn$cok$1@snarked.org> <hjaiid$f7c$1@news.trigofacile.com> <hjar9t$mq$1@snarked.org> <hjnpm4$f5l$1@news.trigofacile.com> <hjq8r4$s5h$1@news.trigofacile.com> <hjqp78$iis$1@snarked.org> <hjsinn$cst$1@news.trigofacile.com> <hjsvgf$vko$1@snarked.org> <hjt1a2$u54$1@news.trigofacile.com> <hjt36j$1m8$2@snarked.org> <hjt45t$167$1@news.trigofacile.com> <hk002q$lni$1@snarked.org> <hk23qr$dok$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <hk3cgr$662$1@snarked.org> Subject: Re: unrelated possible bug with C flag? Date: Sat, 30 Jan 2010 23:46:38 -0800 From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> References: <hic74m$vi8$1@news.trigofacile.com> <hicf9f$ntj$1@snarked.org> <hiclo9$dd4$1@news.trigofacile.com> <hidmvp$vh1$1@snarked.org> <hitipd$rtb$1@news.trigofacile.com> <hiu2ar$707$1@snarked.org> <hiun2p$2mt$1@news.trigofacile.com> <hj0m9c$g98$1@snarked.org> <hj7qh0$ggu$1@news.trigofacile.com> <hj8csn$cok$1@snarked.org> <hjaiid$f7c$1@news.trigofacile.com> <hjar9t$mq$1@snarked.org> <hjnpm4$f5l$1@news.trigofacile.com> <hjq8r4$s5h$1@news.trigofacile.com> <hjqp78$iis$1@snarked.org> <hjsinn$cst$1@news.trigofacile.com> <hjsvgf$vko$1@snarked.org> <hjt1a2$u54$1@news.trigofacile.com> <hjt36j$1m8$2@snarked.org> <hjt45t$167$1@news.trigofacile.com> <hk002q$lni$1@snarked.org> <hk23qr$dok$1@news.trigofacile.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!news.snarked.org!not-for-mail Newsgroups: news.software.nntp Lines: 131 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> NNTP-Posting-Host: 71.118.51.220 X-Trace: snarked.org 1264923995 6338 71.118.51.220 (31 Jan 2010 07:46:35 GMT) X-Complaints-To: newsmaster+complaints@snarked.org NNTP-Posting-Date: Sun, 31 Jan 2010 07:46:35 +0000 (UTC) X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1478