Article View: news.software.nntp
Article #62876Re: NNTP and YENC
From: Bart Crane
Date: Tue, 07 Jan 2003 06:00
Date: Tue, 07 Jan 2003 06:00
108 lines
4140 bytes
4140 bytes
"Dr.Ruud" <'t.leven.is.fijn@life.i$.great> wrote in message
news:av9peu.1eo.1@news.isolution.nl...
> Bart Crane skribis:
>
> > The restrictive view is that a text-stream
> > can consist of any data, except maybe 00h.
> > This restricts compatibility
> > by excluding DOS/Windows computers from have stdio-based
> > software systems.
>
> Idea: find or create a dos2unix-filter and pipe through it.
Hello,
Another filter seems like the ideal solution, one that converts
the binary stream to a text-stream... but, how do you know
what to do with the ctrl-z?
If the filter knew that the data it was processing at that
moment was in yenc-format, it could do the right thing by
escaping it according to the yenc-spec.
But, new, competing protocols can be introduced at any
time, and escaping ctrl-z via the yenc-spec could easily
be inappropriate.
The nntp-client itself is not aware of any encoding formats
for the data it carries. It implements nntp as though it
is just a transport protocol. It is not appropriate for it
to examine and modify the data it is transporting. It can
only send properly formatted requests, detect transport-
level errors, and produce the data from the nntp-server
on stdout.
The data from the nntp-server is piped to a stream
editor which manipulates the data before decoding:
filenames can be re-written, multi-part fixups are
made.
This is where the failure occurs, because the stream
editor (similar in functionality as the Unix "sed", but
nowhere near as functional) receives End Of File,
and so only part of the data to the decoder.
Only the decoder knows the format of the encoded
data, so only the decoder could convert the ctrl-z,
but by then it is too late.
I could modify the decoder to have special command-
line options to set stdin to binary and do only the
ctrl-z escaping... it could run between the nntp-client
and before the stream editor.
But, then I am would have to implement each and
every new protocol, or the ctrl-z could slip in and
terminate the rest of the processing.
This is a viable workaround. Using a yenc-to-
uuencode proxy/filter would also be a quick fix,
but it also has the same "must implement each new
protocol" problem.
Thanks!!!
Bart.
>
>
> See also:
>
> CygWin
>
>
http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-developers/mer
cury-developers.9909/0119.html
>
> google: setmode fileno O_BINARY (1200 hits)
>
>
>
> > while (EOF != (c= getchar()))
> > putchar(c);
>
> First do something like this:
>
> #ifdef WIN32
> if( setmode( fileno ( stdin ), O_BINARY ) == -1 ) {
> perror ( "Cannot set stdin to binary mode" );
> exit(-1);
> }
>
> if( setmode( fileno ( stdout ), O_BINARY ) == -1 ) {
> perror ( "Cannot set stdout to binary mode" );
>
> exit(-1);
> }
> #endif
>
>
> --
> Affijn, Ruud
>
>
Technical Details
Message-ID:
<g2uS9.667119$NH2.46117@sccrnsc01>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!news.ems.psu.edu!news.cis.ohio-state.edu!malgudi.oar.net!news-out.cwix.com!newsfeed.cwix.com!wn13feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mailReferences:
<BXLR9.432835$pN3.48082@sccrnsc03> <ylfzs8tlg7.fsf@windlord.stanford.edu> <e7VR9.570818$%m4.168983@rwcrnsc52.ops.asp.att.net> <av9peu.1eo.1@news.isolution.nl>Show Full Headers
Complete Article Headers
Message-ID: <g2uS9.667119$NH2.46117@sccrnsc01> Subject: Re: NNTP and YENC Date: Tue, 07 Jan 2003 06:00:44 GMT From: "Bart Crane" <svcrane@attbi.com> References: <BXLR9.432835$pN3.48082@sccrnsc03> <ylfzs8tlg7.fsf@windlord.stanford.edu> <e7VR9.570818$%m4.168983@rwcrnsc52.ops.asp.att.net> <av9peu.1eo.1@news.isolution.nl> 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!news.ems.psu.edu!news.cis.ohio-state.edu!malgudi.oar.net!news-out.cwix.com!newsfeed.cwix.com!wn13feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail Newsgroups: news.software.nntp Lines: 107 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: sccrnsc01 1041919244 12.234.193.86 (Tue, 07 Jan 2003 06:00:44 GMT) NNTP-Posting-Date: Tue, 07 Jan 2003 06:00:44 GMT Organization: AT&T Broadband