[NNTP] Article Numbers Becoming Invalid (RFC 3977)

Clive D.W. Feather clive at davros.org
Wed Dec 30 04:01:18 PST 2009


Julien LIE said:
> >Most of your questions have been answered, but the usual way to do this is:
> >
> >   GROUP a.group
> >   ARTICLE
> >
> >The ARTICLE might give a 420 failure response - don't worry if it does.
> >Then repeat the following pair of commands:
> >
> >   NEXT
> >   ARTICLE
> >
> >until you get a 421 response from NEXT.
> 
> Interesting.  It is indeed how it is implemented in INN 2.5.2

The basic model here is:

* Articles are numbered from 1 to some limit X - the next arriving article
will be given a number Y greater than X, after which the limit will become
Y.
* There are two other numbers called LWM and HWM. HWM can increase or
decrease; LWM can increase but never decrease.
* All existing article numbers lie between LWM and HWMN inclusive.
* Articles can be removed and/or reinstated at any time, and LWM and HWM
changed at any time, providing that the above rules are obeyed.
* The GROUP command returns LWM and HWM, and sets the "current article
number" ("CAN") to LWM.
* The NEXT command sets CAN to the lowest number which is greater than CAN
and corresponds to an existing article at that moment (note this could be
greater than the HWM returned by GROUP if a new article has arrived).
* The LAST command sets CAN to the highest number which is less than CAN
and corresponds to an existing article at that moment.

Because articles arrive, are removed, and are reinstated, NEXT then LAST
might not take you back to where you are. Similarly for other sequences.
Similarly, because article LWM might have been removed, GROUP might not
leave CAN referring to a valid article.

> Yet, I do not understand the following paragraph in RFC 3977:
> 
> 6.1.3.  LAST
> 
> 6.1.3.2.  Description
[...]
>   If the current article
>   number is invalid, a 420 response MUST be returned.

> Isn't there a contradiction between the fact that the current article
> number MUST be set to the [next] article in the newsgroup (and therefore
> returning 423) and the fact that the current article number is invalid
> (and therefore returning 420)?

Here, "invalid" is a special value for CAN. CAN is set to "invalid" at the
start of the session and when selectsing an empty newsgroup (but is not
altered following an unsuccessful GROUP).

So you get a 420 if you do NEXT/LAST before GROUP, or in an empty group.
You get 421 when NEXT reaches the end of the numbers. Look at the last two
examples for NEXT.

-- 
Clive D.W. Feather          | If you lie to the compiler,
Email: clive at davros.org     | it will get its revenge.
Web: http://www.davros.org  |   - Henry Spencer
Mobile: +44 7973 377646


More information about the ietf-nntp mailing list