🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #66853

Re: New NNTP draft -- Sections 1-3

#66853
From: Andrew - Supernews
Date: Sat, 18 Oct 2003 12:24
98 lines
6157 bytes
In article <87fzhryxdc.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> [ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
>   document, including credits and references.  This is the first in a
>   series of postings of the sections of the new NNTP draft, which is
>   currently in Last Call. ]

Here are the differences I've spotted between the draft and the behaviour
of our server, with comparison notes. (Some features not implemented yet
may be omitted)
 
>    An NNTP server MAY have an inactivity autologout timer. Such a timer
>    SHOULD be of at least three minutes duration, with the exception that
>    there MAY be a shorter limit on how long the server is willing to
>    wait for the first command from the client. The receipt of any
>    command from the client during the timer interval SHOULD suffice to
>    reset the autologout timer. Similarly, the receipt of any significant
>    amount of data from the client while in the midst of sending a
>    multi-line message to the server (such as during a POST or IHAVE
>    command) SHOULD suffice to reset the autologout timer. When the timer
>    expires, the server SHOULD close the TCP connection without sending
>    any response to the client.

Currently we abort the connection (RST) rather than send FIN if the
inactivity timeout is reached.

> 3.2.1 Generic Response Codes
> 
>    The server MUST respond to any command with the appropriate one of
>    the following generic responses if it represents the situation.
> 
>    If the command is not recognized, or it is an optional command or
>    extension that is not implemented by the server, the response code
>    500 MUST be returned.
> 
>    If there is a syntax error in the arguments of a recognized command,
>    including the case where more arguments are provided than the command
>    specifies or the command line is longer than the server accepts, the
>    response code 501 MUST be returned.

We currently abort the connection if a command line is too long (more than
the maximum allowed number of octets). This is possibly suboptimal and may
be fixed in the future if it becomes an issue.

>                                        The line MUST NOT be truncated or
>    split and then interpreted. Note that where a command has variants
>    depending on a second keyword (e.g. LIST ACTIVE and LIST NEWSGROUPS),
>    then 501 MUST be used when the base command is implemented but the
>    requested variant is not, and 500 MUST be used only when the base
>    command itself is not implemented.
> 
>    If the server experiences an internal fault or problem that means it
>    is unable to carry out the command (for example, a necessary file is
>    missing or a necessary service could not be contacted), the response
>    code 403 MUST be returned.

This appears to be new.

We currently return 503 for the only case where this applies to us; if the
client attempts a POST command but no posting server can be contacted (we
tunnel POST operations to a specialised server). This condition is, however,
rare since we maintain availability of the posting servers.

>    502: it is necessary to terminate the connection and start a new one
>       with the appropriate authority before the command can be used.
>       Note that the server MUST NOT close the TCP connection immediately
>       after a 502 response except at the initial connection (Section
>       5.1) and with the MODE READER (Section 5.2) command. See also the
>       latter command for historical usage of this response.

Currently I believe we only return 502 in the initial banner or in response
to a failed authentication; in both cases we close the connection (with FIN).
Since authentication is an extension this does not strictly speaking conflict.

>    If the server has to terminate the connection for some reason, it
>    MUST give a 400 response code to the next command and then
>    immediately close the TCP connection.

Existing clients don't respond wonderfully well to this, according to what
reports we have, but I see no obvious practical alternative. We currently
return this error for sessions that exceed data transfer limits, but
operational experience is still sketchy.

>    The client MUST be prepared to receive any of these responses for any
>    command (except, of course, that the server MUST NOT generate a 500
>    response code for mandatory commands).

One other odd feature of our server: we return a 500 error and close the
connection if the first command of a session appears to be an attempt to
speak HTTP. This is for two reasons: one to prevent abuse via HTTP proxies,
and the other because our server does in fact answer on port 80 as well and
can therefore get into strange conversations with HTTP clients as a result.
This includes cases where the first command is "POST" - we check for the
presence of HTTP-like arguments to distinguish this from legitimate use of
the POST command. This may be outside the scope of a standard.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Technical Details
Message-ID: <slrnbp2c8b.2sl5.andrew+nonews@trinity.supernews.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.20140818.mbox.gz!text1.nnrp.aus1!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!128.32.206.55!newsfeed.berkeley.edu!ucberkeley!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <87fzhryxdc.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <slrnbp2c8b.2sl5.andrew+nonews@trinity.supernews.net>
Subject: Re: New NNTP draft -- Sections 1-3
Date: Sat, 18 Oct 2003 12:24:43 -0000
From: Andrew - Supernews <andrew+nonews@supernews.com>
References: <87fzhryxdc.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!text1.nnrp.aus1!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!128.32.206.55!newsfeed.berkeley.edu!ucberkeley!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
Newsgroups: news.software.nntp
Organization: http://www.supernews.com - all your nntp are belong to us
Reply-To: andrew@supernews.com
User-Agent: slrn/0.9.7.4 (FreeBSD)
X-Complaints-To: abuse@supernews.com
Lines: 98