Article View: news.software.nntp
Article #30064Re: REPOST: Re: Content-Transfer-Encoding: binary
From: Matt Dillon
Date: Mon, 27 Jul 1998 00:00
Date: Mon, 27 Jul 1998 00:00
76 lines
3827 bytes
3827 bytes
:In article <19980727203523.032$aP@newsreader.com>,
:Curt Welch <curt@kcwc.com> wrote:
:>dillon@best.net (Matt Dillon) wrote:
:..
:>
:>Yes, the NNTP protocol can transfer binary data if the server is written
:>correctly (ignoring the forced trailing CR LF issue which is minor). But
:>as far as I know, Diablo and inn aren't because they store articles in the
:>Unix standard format with lines ending in a single LF. Here's an example.
Uh, no. The NNTP protocol requires each 'line' to be terminated with
the sequence CR+LF. There is no limit on the line length. All this
means is that whenever you see an LF in the article body you simply
replace it with a CR LF, and whenever the receiver sees a CR LF in the
article body it simply replaces it with an LF because it is guarenteed
due to the original escaping requirement that the preceeding CR was
added by the code. Other CR's in the body are passed through untouched,
so the result is a wash.
If the original article contains a CR LF combination, the escaped article
will contain CR CR LF and the receiver will unescape it back into CR LF.
Diablo, INN, etc etc etc all store article bodies *EXACTLY* as received.
The NNTP protocol can be thought of as escaping any LF's embedded in
binary data into CR LF's, and then de-escaping them back to LF's on the
receiving end.
:>
:>How do you store it on disk? As:
:>
:>X LF LF
:>
:>Right? Diablo (at least as of version 1.11) and inn (with the traditional
:>storage format) store articles on disk with the Unix \n end of line
:>convention. This translation causes problems when trying to tranport raw
:>binary data. (I'm not talking about what a client does when it gets the
:>data, I'm talking about what Diablo does).
:>
:>When you send it back out to the downstream feed doesn't it end up going
:>out like this:
:>
:>X CR LF CR LF
If the original article as written in someone's text editor is this:
X CR LF LF CR CR CR LF Y LF CR LF Z CR CR LF
Then the article escaped with the NNTP protocol is this:
X CR CR LF CR LF CR CR CR CR LF Y CR LF CR CR LF Z CR CR CR LF
And when unescaped by diablo or INN or whatever, the article is stored
in the spool in it's original form. Unescape the above info and you
get:
X CR LF LF CR CR CR LF Y LF CR LF Z CR CR LF (same as figure 1)
Diablo, INN, etc.... store the article bodies on disk *EXACTLY* as it was
originally posted prior to the original NNTP escaping. From the
point of view of the transit software, the article bodies are binary
data.
-Matt
:>
:>--
:>Curt Welch http://CurtWelch.Com/
:>curt@kcwc.com Webmaster for http://NewsReader.Com/
--
Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet
Communications
<dillon@best.net> (Please include original email in any response)
Technical Details
Message-ID:
<6pjaar$9te$1@flea.best.net>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-mailReferences:
<slrn6qs63j.8b9.usenet@hmmm.colo.erols.net> <19980727160307.629$hL@newsreader.com> <6pintb$1eo$1@flea.best.net> <19980727203523.032$aP@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <6pjaar$9te$1@flea.best.net> Subject: Re: REPOST: Re: Content-Transfer-Encoding: binary Date: Mon, 27 Jul 1998 00:00:00 +0000 From: dillon@best.net (Matt Dillon) References: <slrn6qs63j.8b9.usenet@hmmm.colo.erols.net> <19980727160307.629$hL@newsreader.com> <6pintb$1eo$1@flea.best.net> <19980727203523.032$aP@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 X-Deja-AN: 375511681 X-Trace: 901590174 8156 dillon 206.184.139.131 Organization: Best Internet Communications, Inc. Newsgroups: news.software.readers,news.software.nntp