🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #35040

Re: NNTP and partisan politics, or something.

#35040
From: Curt Welch
Date: Thu, 28 Jan 1999 00:00
91 lines
5306 bytes
meowing@banet.net (Fluffy) wrote:
> I'm worried about NUL because INN's rnews is documented to choke on
> them.  It would be easy to shrug off rnews as ancient history, except
> that satellite feeds and XBATCH have brought the format back into
> relatively common usage.

Well, not all satellite feeds use that.  Avi's www.isp-sat.com (which I
use) sends the articles in a packet stream in NNTP wire format (which is
why the latency on his feed is so low).  There's no batching going on with
his feed.  I don't know however what his sofware would do with a NULL.

> Now, about linefeeds.  I know there has been talk of accommodating
> more-or-less pure binary articles.

My thought on pure binary is that it will never happen.  It's just too
hard to make work (because of the various EOL conventions and problems
with NULL) and buys us to little for all the effort.

However, as I write this new NNTP server, I'm making sure it can deal
correctly with everything.  The only limit the code (as structured) puts on
articles are their maximum length.  Anything that can be sent over NNTP can
be stored and re-transmitted exactly as received.  This includes being able
to deal with embeded NULLs, CRs, and LFs.  It also has no restrictions on
the length of lines or headers.

I will reject articles which don't meet certain requirements, but it won't
be because my code can't deal with it - so those restrictions will be easy
to change later.

> Again, rnews (which, in my little
> mind, is still the canonical representation even if we don't always
> explicitly use it any more) presents a problem, since an end-of line is
> always counted as one character no matter how it is represented.  This
> is documented in 1036 and the news.5 page from C News.

son-of-1036 (and I think the latest rewrite of 1036) just avoid the problem
by saying LF and CR and NULL are not allowed within lines - and that the
line termination (EOL) will vary from system to system.

In order to make pure-binary work, this standard would have to be changed.
You have to define exactly what the EOL characters are (and the only two
real options there are LF or CR LF).

And then you have to define the mapping form this binary format to NNTP
wire format.  If the offical EOL is CR LF in the article, then the mapping
is obvious (there is none other than the dot escaping) - but systems like
old inn and Diablo which store articles in LF terminated line format would
not be able to correctly pass the new "pure-binary" articles without
corrupting them if it was done this way.

The other option would be to make LF the "offical" article EOL format, and
then define a mapping that says "all" LF's (including ones in a pure-binary
section of an article) are translated to CR LF when sent over NNTP and the
reverse is done to recover the "true" underlying "binary" article.  This
would be compatible with the current way Diablo works.

But, if you just store the aritcle in raw NNTP write format like I'm doing
with my new server, then either of those two conventions would work fine
wihtout making any changes to my server.

> The upshot is that for news, it would appear that the assumption that
> NNTP wire format is the "true" representation of an article isn't at
> all safe, and that in fact linefeeds are supposed to be munged
> into some consistent representation regardless.

If you are dealing with a "pure" NNTP server (i.e. the only way to get
articles in and out of the server are though NNTP) then that's not
an issue.  You should store the articles in NNTP wire format (i.e. with
the CR LF, and don't do any type of CR LF -> LF or LF -> CR LF
translations. Then you will be able to support any possible future article
format.

It's only an issue if you need to support some other "view" of the
articles - like a Unix one-article-per-file spool where lines
are LF terminated. Or if you need to create or accept rnews batches.
But then, the translation problem should be addresed when you create
the batch or accept it if possible.

On the NNTP side, I'd strongly advise you to structure things so
you can receive and retransmit articles without changing them - even if
they contain lone LFs or CRs in the lines.

> Anyone else's head hurt yet too?

All the time.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Technical Details
Message-ID: <19990128115132.096$Cn@newsreader.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.mbox.zip!not-for-mail
References: <78mj9t$lli@meow.invalid> <78n7kk$i3q$1@east43.supernews.com> <78ofnf$pal@meow.invalid>

Show Full Headers
Complete Article Headers
Message-ID: <19990128115132.096$Cn@newsreader.com>
Subject: Re: NNTP and partisan politics, or something.
Date: Thu, 28 Jan 1999 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <78mj9t$lli@meow.invalid> <78n7kk$i3q$1@east43.supernews.com> <78ofnf$pal@meow.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 437988396
X-User: Curt@NewsReader.Com
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5 %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
Newsgroups: news.software.nntp