🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62797

Re: NNTP and YENC

#62797
From: Bart Crane
Date: Sun, 05 Jan 2003 02:48
59 lines
3065 bytes
"greg andruk" <gja@meowing.net> wrote in message
news:1prda3yvcm5x4.dlg@meowing.net...
> Bart Crane wrote:
>
> > The problem is that NNTP servers are forwarding YENC-encoded
> > data, but this data includes control-characters, one of which, 0x1A,
> > is interpreted within text-streams on DOS/Windows to mean "End
> > Of File."
>
> > This causes sed and grep to terminate early.  You can imagine my
> > consternation.
>
> This is a bug in the tools you are using.  The versions of grep and sed
> that I use with Windows do not choke on control characters, vertainly not
> the old CP/M EOF.  If you have the sources, try fixing them to open files
> in binary mode.

The point behind text- vs. binary-mode, cooked- vs. raw-mode, was so
that C progams can be written portably, using constructs like:

    if ('\n' == *p)

If there was no difference between text- vs. binary- mode, then text-
processing utilities would need special-casing on a per-platform basis:

#if defined(LINUX) || defined(UNIX)
    if ('\n' == *p)
#endif
#if defined(WIN32)
    if ('\r' == *p && '\n' == *(p+1))
#endif

What you suggest is to re-implement the C runtime library code in
every program, for every platform... doesn't that strike you as
counter-intuitive?

It is unreasonable to have to rewrite software written to published
standards because of the introduction of new software that ignores
those standards.  In this particular case, these programs compile
for multiple platforms, have no platform-dependent code, and have
functioned without error for 10+ years... and who knows where
the source is.

The immediate solution is a 1-byte change to YENC-encoders to
include 0x1A as a Critical Character.  The YENC spec requires
that every byte generated be examined.  If it is a Critical Character,
then it must be escaped.  This is not a big deal.

Oh, and no change to YENC decoders is required to fix my
CTRL-Z situation.

Thanks for the input.

Bart.



Technical Details
Message-ID: <O1NR9.567084$P31.195944@rwcrnsc53>
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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail
References: <BXLR9.432835$pN3.48082@sccrnsc03> <1prda3yvcm5x4.dlg@meowing.net>

Show Full Headers
Complete Article Headers
Message-ID: <O1NR9.567084$P31.195944@rwcrnsc53>
Subject: Re: NNTP and YENC
Date: Sun, 05 Jan 2003 02:48:14 GMT
From: "Bart Crane" <svcrane@attbi.com>
References: <BXLR9.432835$pN3.48082@sccrnsc03> <1prda3yvcm5x4.dlg@meowing.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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail
Newsgroups: news.software.nntp
Lines: 58
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: 12.234.193.86
X-Complaints-To: abuse@attbi.com
X-Trace: rwcrnsc53 1041734894 12.234.193.86 (Sun, 05 Jan 2003 02:48:14 GMT)
NNTP-Posting-Date: Sun, 05 Jan 2003 02:48:14 GMT
Organization: AT&T Broadband