🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #44467

Re: Batched ARTICLE commands

#44467
From: Curt Welch
Date: Sat, 26 Feb 2000 00:00
153 lines
9219 bytes
bill@scconsult.com (Bill Cole) wrote:
> In article <20000225234216.661$0Y@newsreader.com>, curt@kcwc.com (Curt
> Welch) wrote:

> MODE  commands (in addition to POST, IHAVE, and AUTHINFO) cause a state
> change when successful. It's a poor client that assumes the success of a
> command which causes a state change and proceed to  act as if that state
> change has succeeded.

You are confusing the way INN works with the official definition of NNTP
in the RFCs.  INN is NOT the official definition of the NNTP protocol
(though it's a a very practical defacto standard for someone trying to
write an NNTP client).

INN defines a version of the protocol which has two states (innd vs nnrpd)
or feed commands vs reader commmands.  And it uses the MODE READER command
to switch from feed state, to reader state.  And at the same time, it
drops characters from the stream in that transistion.  None of this
behavior has every been documented as far as I know except in the inn
source code.

All this behavior is _VERY_ implementation dependent and very much in
violation of all the NNTP RFCs.  And it would be _VERY_ stupid to write the
RFC just to fit INNs broken implementation of NNTP.  MODE READER is not
something any protocol designer would have put into NNTP and it's certainly
not something that's required or useful.  It's only there to help deal
with a problem that INN has.

MODE READER does cause a state change in inn.  But it DOES NOT cause a
protocol state change in the official definition of the protocol.

MODE READER has been added to the latest RFC, but it's listed
as a command which a client MAY send at any time.  There is nothing in
the RFC about the server changing states at that time.

Older servers don't even implement the command (as I recall, it wasn't
even in INN at first -- it was added later).  So, all clients that
I know about, send it at the start of the session (just in case they are
talking to one of those broken INN servers and just in case inn wasn't
already in the correct nnrp mode), and then completely ignores the return
code.

Because no RFC has every been written that correctly defines how MODE
READER works, then NO client should ever assume anything about the return
codes.  An error response (4xx or 5xx) from a MODE READER doesn't tell
the client shit about whether reader commands are going to work or not. So
any good client will correctly ignore the return code, and proceed to try
and read news.  If the reader commands don't work, it will then deal with
that probelm.

So, please, don't accuse a client of being poor because it ignores the
return codes a command which you have no way of telling what happens
no matter what code it returns.  And one which, in all of it's known forms,
will never level the stream in a different protocol state like IHAVE or
POST or AUTHINFO.

It's important for clients to wait for the return call from MODE READER
not because it changes state, but because inn has a known bug where
it may end up droping characters sent after the MODE command but before
the response.  This is very different from the optional protocol state
changes (from command mode to data input mode) that occure with IHAVE
and POST.  The first is a real-world inn bug issue, the second are valid
official NNTP protocol issues.

Please don't put these together as if they were the same type of issue.

> I know that some servers treat MODE READER as a no-op, but it is not
> required that all servers do so and it is bad form for a client to assume
> that if it MUST send the command, that it is a no-op.

And it's much worse for the client to assume anthing about the return
codes it receives from a MODE READER command.

> > Do you see the point I'm making here?
>
> Yes, and I agree that a server which chucks data on the stream at such
> state-change points is acting badly. It's just that any client which
> might have a problem with that behavior is broken in a worse way.

Well, no.  The first is a clear violation of the RFC.  The second isn't.
So you are saying a client which follows the RFC is broken in a worse
way than a server which does't follow the RFC?

I'm sorry, you may think that since INN came first, that clients should
use it as the "definition" of what a client "should" do, but I just don't
see it that way.

From a very real and practical sense, any one writting a NNTP client that
might need to talk to an INN server some day, should deal with this issue
correctly.  That's why I think the RFC needs to say something about this.

But this dropping character issue is simply in INN bug. And it is a simple
thing to fix.  There's no technical reason servers need to behave that way.
And like I said, as far as I know, INN is the only server with the bug.  So
talking about it as if it was a valid NNTP conecpt -- like IHAVE and POST
-- is just bogus.

> > The problem is that by the very nature of the protocol, many people
> > think of it as a command->response->command->response type of a thing.
> > They assume that clients won't send two commands before waiting for a
> > response. And in most cases, they are correct, this is how most clients
> > use it.
> >
> > But, the RFC, as written, implies that it is valid for a client to
> > pipeline commands.  And this creates the problem that a server author
> > may falsely assume clients won't pipeline commands (or because of the
> > nature of the protocol, just never think about the posibility).  And a
> > client author, on the other hand, may decide to take advantage of the
> > pipeline features of the protocol to improve performance.  And, because
> > it really is valid, this client will work fine with some servers, but
> > break on others that didn't actually follow the RFC.
> >
> > So the RFC has a problem.  Granted, it's a small problem, and only one
> > of many small problems, but it's a problem none the less.
>
> Easily solved: define a state diagram and require that clients MUST NOT
> attempt to pipeline across state changes. Doing so is stupid to begin
> with, but the existence of a state diagram for SMTP is IMHO what results
> in only the stupidest of client software attempting to do so.

I think it would be very wrong to officially include INNs idea of "states"
into the RFC.  No one I know of besides INN does it that way.  There are
lots of servers which only implement subsets of the full NNTP command
set, but most don't change states, and when they do, it's more likely
to happen at AUTHINFO time than as the result of a MODE command.

I think it would be incredibly stupid to put inns broken behaior into the
RFC and then force all the other server authors to waste their time
duplicating that behavor in their previously non-broken servers.

The solution is simple however.   Include MODE READER like they have
already done, but explain that some servers require this command to be sent
before reader commands will work -- so every client SHOULD send this before
trying to use any of the reader commands.  And, warn that some clients
have been known to loose characters when switching modes, so pipelining
SHOULD NOT be done when this command is used.

Note I say SHOULD NOT, because servers MUST accept pipelining everywhere
in my opinion - servers that can't, like inn, are broken, and should be
fixed (or shout just remain broken and not care about it).

And warn clients about the dangers of pipelining on other potentially
dangerous places like AUTHINFO, or maybe even durring a POST (if like
sendmail seems to do - it may fork or a separate process to read the
data and loose characters before and after the data.)  But, I'd suggest
this warning only be added to the RFC if we can actually find a real-world
server that has this problem.

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

Technical Details
Message-ID: <20000226153651.615$gx@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: <220220000104304154%planb@newsreaders.com> <240220000054115493%planb@newsreaders.com> <20000225004139.313$nK@newsreader.com> <250220001158002643%planb@newsreaders.com> <20000225125610.123$Ow@newsreader.com> <yl6itzdjb0r.fsf@independence.ecn.ou.edu> <20000225162640.211$2M@newsreader.com> <87n1opgdej.fsf@erlenstar.demon.co.uk> <20000225180328.114$Ys@newsreader.com> <87zosog8kl.fsf@erlenstar.demon.co.uk> <20000225234216.661$0Y@newsreader.com> <bill-2602001142340001@192.168.254.8>

Show Full Headers
Complete Article Headers
Message-ID: <20000226153651.615$gx@newsreader.com>
Subject: Re: Batched ARTICLE commands
Date: Sat, 26 Feb 2000 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <220220000104304154%planb@newsreaders.com> <240220000054115493%planb@newsreaders.com> <20000225004139.313$nK@newsreader.com> <250220001158002643%planb@newsreaders.com> <20000225125610.123$Ow@newsreader.com> <yl6itzdjb0r.fsf@independence.ecn.ou.edu> <20000225162640.211$2M@newsreader.com> <87n1opgdej.fsf@erlenstar.demon.co.uk> <20000225180328.114$Ys@newsreader.com> <87zosog8kl.fsf@erlenstar.demon.co.uk> <20000225234216.661$0Y@newsreader.com> <bill-2602001142340001@192.168.254.8>
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: 590370975
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
X-User: Curt@NewsReader.Com
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
Newsgroups: news.software.nntp