🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #44541

Re: [NNTP Draft] 4. Basic Operation

#44541
From: Curt Welch
Date: Sun, 27 Feb 2000 00:00
132 lines
6535 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
> >>>>> "Curt" == Curt Welch <curt@kcwc.com> writes:

>  Curt> I've seen Message-IDs defined to be a max of 512 octets.
>
> Where? USEFOR doesn't give a limit, though I think it probably should.

I checked 1036, and it makes no mention of limits.

Son of 1036 says:

  Message IDs MUST be no longer than 250 octets, including the
  "<" and ">".

and also:

  The length limit is undesirable, but is present in widely-used
  existing software. The limit is actually 255, but a small safety
  margin is wise.

That sounds to me like it was specified somewhere else and just copied
into son-of-1036.  Maybe 822?

So maybe I just rememberd the wrong power of two?  And the NNTP 512 limit
isn't an issue?  I've certainly never seen a case in real-life were it
was ever close to being a problem.  And anyone who generates message-IDs
longer than 80 characters deservs to have something cut off anyway :).

I'm mostly against length limits in these standards, but the Message-ID
is one place where I think there should be a length limit.  And 250
sounds good to me.

>  Curt> How then is NNTP supposed to implement a "ARTICLE <MID>"
>  Curt> command if the max command length is limited to 512?
>
> MIDs should not ever be that long. Personally I restrict 'em by
> enforcing the NNTP command length limit strictly. (Helps to avoid
> buffer overrun issues, too.)
>
>  Curt> Why not just rase this to something more reasonable like 1000?
>
> Because that would be a gratuitous incompatibility with RFC 977?

Thinking about the line lentgh limit a bit more, it seems to me that
what's more important than setting a limit in the RFC, is clearly
defining what a client can expect to have happen if it sends a command
line which is too long for the server (no matter what the length happens
to be.).

Checking my code, I find I return a "400 command too long" result. Don't
know why I picked 400 -- it may have come from some other server
or I might just have made it up.  It should be in the 5xx range (if
not the 6xx :) because it's a really bad error).

This is an example of a place where a code should be allocated for this
error, and not used for any other response.

I also think it would be useful to include wording that required the NNTP
server to correctly read the entire line even if it was too long.  I.e.
spliting it up and trying to parse it as two or more commands would not be
allowed.  This way, the client would not be required to length check all
the commands before they were sent as long as it could deal with the LINE
TOO LONG response code in a reasonable way for all commands.

> You mean that the RFC should state that sending a response before
> closing was common, but is now forbidden?

Right.  And include the 503 number as well.  That should be in the
list of commands that could be received as a response to any command
with a note that cleary states servers are now forbidden to send
it but it was common in some older servers.

If you assign new response codes in the future that could be
a valid response to any command, you want to avoid common numbers
like that which were used in the past, so it's good that the number
lives on for a while in the current RFC.

> I guess a compatibility note of some sort might be in order.

It helps client authors get into the right frame of mind when writing the
code.  It means that for those old servers, if you don't (or can't - as the
case with some socket interfaces) check the status of the read side of the
connection before sending a command, you may find what looks like a 503
response to any command.

It would also be wise to explicity declare that 503 could NEVER be sent
by a server for any reason in this version of the RFC.

>  >> keyword that is the first part of the command. In addition,
>  >> below is listed a general set of response codes that MAY be
>  >> received at any time.
>
>  Curt> I don't really understand where there list is?
>
> Nor does anyone else, apparently.

There should be a list however, and it should include things like
the 503 and some new code for "LINE TO LONG", as well as others like
the 480 authentication required.

>  >> A server MUST respond to an unrecognized, unimplemented, or
>  >> syntactically invalid command with a negative response
>  >> code(status indicators of the form 5XX).  A server MUST
>  >> respond to a command issued when the session is in an
>  >> incorrect state by responding with a negative status
>  >> indicator. This may be from either the 4XX or 5XX group as
>  >> appropriate.
>
>  Curt> Are these codes that can be received at any time?  i.e. is it
>  Curt> OK to send any 4xx or 5xx code as a response to any command?
>
>  Curt> I think it would probably be wise to more precisely define what
>  Curt> a server MUST return for a few cases like "command unknown".
>  Curt> Or "Other error".  Or at least talk a little more about how to
>  Curt> correctly pick codes.
>
> RFC 977 had this a little bit better, I think.
>
> A list of error codes, as 977 has, would probably help to clarify
> things a great deal, and expose some inconsistencies in the draft
> (such as the misuse of 500 in a few places).

It seems to me that the bigest single issue with the RFC is all
centered around the use of error codes.  Nothing else about the
RFC bothers me as much as that does -- both as a server author
and as a client author.

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

Technical Details
Message-ID: <20000226232844.171$mz@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: <87u2ivd36l.fsf@erlenstar.demon.co.uk> <20000226190559.229$6S@newsreader.com> <877lfrbhub.fsf@erlenstar.demon.co.uk>

Show Full Headers
Complete Article Headers
Message-ID: <20000226232844.171$mz@newsreader.com>
Subject: Re: [NNTP Draft] 4. Basic Operation
Date: Sun, 27 Feb 2000 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <87u2ivd36l.fsf@erlenstar.demon.co.uk> <20000226190559.229$6S@newsreader.com> <877lfrbhub.fsf@erlenstar.demon.co.uk>
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: 590492579
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