Article View: news.software.nntp
Article #62803Re: NNTP and YENC
From: Bart Crane
Date: Sun, 05 Jan 2003 09:44
Date: Sun, 05 Jan 2003 09:44
320 lines
12780 bytes
12780 bytes
"Curt Welch" <curt@kcwc.com> wrote in message news:20030104215829.905$Rh@newsreader.com... > "Bart Crane" <svcrane@attbi.com> wrote: > > It was also > > suggested that I email yenc.org, but I had already done so and > > received no response. It is a ridiculously small thing, a 1-byte change > > to the encoder-spec, and no change on the decoder. > > Hey, I talk with Juergen all the time. And I asked him to fix the link to > my newsreader.com service on the yenc.org site which has been broken since > it was added and he's not gotten that done either. We are all busy, some > things are more important than others. There is nothing more important than the uninterrupted processing of my NNTP-data!!! There were five Critical Characters defined in YENC at one point, and then there were four. This indicates to me that there is some question about what exactly should constitute a "Critical Character". If there had been a Request For Comments, all this could have been pointed out before it broke my system. At the least, I would have been able to take action to prevent my system from breaking, instead of the frustrating hours spent trying to figure out what could possible be going wrong... > > Your suggestion that the yEnc spec be changed to say all encoders should > escape ^Z is questionable since it's only a minor problem for some people > (you) and would cause a size increase for _everything_ posted to Usenet in > yEnc. How much does everyone not having problems with ^Z really owe you? In the quest to reduce overhead, he went 1 byte to far. No big deal. Fix it. One version of yenc had 5 Critical Characters. The next had 4. What is the big deal? Add CTRL-Z, and compatibility is restored. > > > 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. > > > > So, I am posting here, so as to ask those who actually run news > > servers, would you please reject any article that is posted to your > > server that contains ANSI-defined control-characters (hex 00 to 1F and > > FF), except those defined by the NNTP spec as allowed (CR, LF, TAB)? > > You are funny. So we should just reject all yEnc articles? :) You do > understand that they all contain large numbers of control characters don't > you? Originally, I was concerned only with CTRL-Z. Then, I realized, that was as selfish a position as the one that caused this situation. Thus, there was no choice but to include all non-textual characters. > > We have been working for years to get all of Usenet to transport 8bit data. > You are not going to get anywone to reject articles with control characters > - not even ^Z alone. This is not a "7- to 8-bit" issue. This is a text- vs. binary-stream issue. The NNTP authors specifically state that the Response Data is "textual". The ambiguity regarding the definition of "textual" is confused by the 8-bit issue. It is not related. The NNTP authors did not define what "textual" meant, because it would link implementation with specification. The implementation is operating- system specific, and is manifested in whatever differences exist between opening a file in "r" and "rb". In DOS/Windows, CR LF is mapped to LF, and SUB is interpreted as End Of File. To maintain compatibility with DOS/Windows, only SUB need be escaped. > > > Or, if that is too onerous as a first step, could you please do so if the > > article contains 0x1A??? Or, could you forcibly insert into the subject: > > header a key phrase so I can grep -v those articles out of the listing? > > Nope. > > > That may sound extreme, but, RFC 977 says > > Good try. Nope. RFC 977 says that Response Data is "textual". Could you tell me what you define the difference between textual and non-textual data to be? What data would an NNTP server normally reject as not being valid? One answer I got was "00h". That does not seem to be a very useful definition. Why not include 1Ah, since it has special meaning to text-streams, and has for over 20 years? > > > Without this concept, text-processing utilities would need special-case > > coding to account for how different operating systems implement > > text-streams. > > They do have special special-case coding. What do you think "rb" and "wb" > is? Application code is not aware of the underlying translation performed on the data processed by fread() and fwrite(). This raw- vs. cooked-mode stuff, binary- vs. text-stream stuff is all very old... I can see that the fact that CTRL-Z == EOF is not common knowledge for the people in these groups. > > > With this concept, one can write newsreader software in > > portable C and expect it to compile and function properly on any > > platform. > > There's no such thing as "portable C". I've been writing in it for 25 > years and have writen code that ran on over 250 different versions of Unix > and believe me, it's not portable. Writing text-processing utilities is fun, and portable! That is because there is a spec regarding what constitutes a text- stream, defined by the operating system, and the implementers of the C runtime library for that operating system provide the translation between '\n' and whatever the operating system uses as the end-of-line delimiter. It also does whatever is necessary to present the End Of File condition. Some operating systems use a special character, like CTRL-Z, and others use a size-value in the directory entry, and others use a resource-fork -- just guessing here!!! -- you get the picture. The end-result is that you can write filter programs that compile on any platform with stdio.h. Text-mode in Unix and Linux is not very different from binary-mode. In fact, I can't think of a single difference. Yet, there is this concept of data being "textual", of files being used in "text-mode", of "text-streams", of NNTP Response Data being "textual". You may not be confident of what they meant by "textual", but I am: it is whatever difference "r" has from "rb". You can make 256 rows of byte-values, with a column for each operating-system, and go through it byte by byte. "Is this byte-value in a text-stream interpreted specially by this operating system?" You really only have to do it for the first 32 bytes, because everyone has standardized on the ANSI definition of control-codes being 00..1F. You will probably find only CTRL-Z is an issue. This is all very old stuff. I wish I had heard about this before version 1.4, it is a teensy little change for CTRL-Z... the standards process is designed to root out things like this. The world is not one big unix box. > > > That has been my expectation and experience, until now. > > You need to fix your code. Don't ask the rest of the world to fix there's > because you can't program. Text-processing utilities running under DOS/Windows interpret CTRL-Z as End Of File. This is not something I am making up. This is not something I can change. Don't expect the rest of the world to have the same computer as you. The world is not one big unix box. > > Nobody puts ^Z into files anymore to mean end-of-file. If the stupid libc > routines you use can't read text files with ^Z in them, write your own that > can. If you are someone who operates an NNTP server, then I am asking you, "why are you including CTRL-Z in the data? Don't you know that that means End Of File in DOS/Windows?" I think the answer to that is obviously "no", maybe "now I do.". > > If for some god-forsaken reaon you are trying to store Usenet articles in > old CPM style "files" which have a length which is a multiple of 128 bytes > instead of having a modern byte length, then you need to encode the data as > you store it and escape the ^Z in the data to something else. Here is a shortened version of the pipeline: echo 10984 | newsget netnews.attbi.com alt.test some | sed -f fixnews | decode So, you can see that the data is not stored, except as it exists in the pipeline. The problem is that embedded CTRL-Z's cause sed to terminate as though it reached the End Of File. > > NNTP data is 8 bit binary data now. Get used to that. It's only going to > get worse. This is not an 8-bit problem. This is a text- vs. binary-mode problem. > > > This is not an 7- vs. 8-bit issue. No matter the number of bits in > > a byte, if the value is in the range of 0..31 or is -1, ANSI defines it > > to be control character. In a text-stream, a "control character" may > > be interpreted specially. The NNTP authors explicitly allow only > > two control-characters, CR and LF, and are vague on TAB. For > > good reason, because other control characters have other meanings > > on other operating systems, such as 1A == End Of File. > > Sorry, the NNTP specs have nothing to do with Usenet. The people that > write and run news servers are what control how their segement of Usenet > works and nobody is going to start blocking ^Z now. It does seem as though you and others are trying to say that NNTP servers are not bound by the NNTP spec anymore, but without actually saying that. > > > I would very much like to return to treating the output from NNTP > > servers as "textual". > > Sorry. Those days are gone. Fix your code to deal with Usenet how it is > or don't call your code "usenset software". Interesting... was there a Request For Comments regarding dropping the "textual" aspect of NNTP data? Gee, I was angry at how YENC was introduced without "going through channels", but it seems par for the course!! > > > That was the original intent, that was the > > existing practice, and of all of the reasons for using YENC, none > > preclude continuing that practice. > > > It is a dark day indeed if a network protocol can be introduced and > > adopted that is so clearly in violation of multiple pre-existing > > standards, and does so in such a way that breaks pre-existing systems > > based on those standards. Okay, you got me: it breaks one pre- > > existing system. But that system is mine!!! > > What on earth is so hard about fixing your system so it works? It would be much harder than including CTRL-Z as a Critical Character in the YENC spec. > > BTW, the last time you suggested this I changed my yEnc encoders so they > escape ^Z for you. But don't ask me to go any further. Hey, thanks!! That'll fix it for me!!! > > The odds of you getting yEnc changed, and getting everyone out there to > upgrade to a recent version of yEnc which escapes ^Z is about zero. Naturally. That is why I am asking the NNTP server guys to help. If all YENC-data containing CTRL-Z were rejected, because it breaks compatibility with existing systems, I bet the spec would be updated and encoders updated pretty quick!! > Your > only option is to figure out how to make your code work even if ^Z is in > the data. Another option is... ZENC!!! That way we can post content once in YENC, really fast. Once again in ZENC, just as fast, but compatible with all systems. And once again in UUENCODE, for everyone else!! > > -- > Curt Welch http://CurtWelch.Com/ > curt@kcwc.com Webmaster for http://NewsReader.Com/ Bart.
Technical Details
Message-ID:
<j8TR9.568229$WL3.160487@rwcrnsc54>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!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mailReferences:
<BXLR9.432835$pN3.48082@sccrnsc03> <20030104215829.905$Rh@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <j8TR9.568229$WL3.160487@rwcrnsc54> Subject: Re: NNTP and YENC Date: Sun, 05 Jan 2003 09:44:47 GMT From: "Bart Crane" <svcrane@attbi.com> References: <BXLR9.432835$pN3.48082@sccrnsc03> <20030104215829.905$Rh@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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail Newsgroups: news.software.nntp Lines: 319 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: rwcrnsc54 1041759887 12.234.193.86 (Sun, 05 Jan 2003 09:44:47 GMT) NNTP-Posting-Date: Sun, 05 Jan 2003 09:44:47 GMT Organization: AT&T Broadband