🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Matto Fransen Fri, 03 Feb 2023 19:53
RFC3977: understanding "last" and "next"
#90059
Author: Matto Fransen
Date: Fri, 03 Feb 2023 19:53
74 lines
3389 bytes
Hi,

Reading https://www.rfc-editor.org/rfc/rfc3977.html, I have some
questions understanding "last" and "next".

This is what the RFC says about "last":

   If the currently selected newsgroup is valid, the current article
   number MUST be set to the previous article in that newsgroup (that
   is, the highest existing article number less than the current article
   number).  If successful, a response indicating the new current
   article number and the message-id of that article MUST be returned.
   No article text is sent in response to this command.

and the RFC gives some examples:
( [C] = client, [S] = server)

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved
      [C] LAST
      [S] 223 3000234 <45223423@example.com> retrieved

and:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] LAST
      [S] 422 No previous article to retrieve

From the first example, I get the impression that, when the client
asked "next", the article 3000237 was the first above 300234, hence
the server responded with the number and message-ID of this article.

When the client then asked "last", the server looked at what the
very first article is below 3000237, and comes with 3000234.
- Is this correct?
- Does this mean that the server must keep state, that is,
  remembering that it answered 3000237 on a previous command?

This is  what the RFC says about "next":

   If the currently selected newsgroup is valid, the current article
   number MUST be set to the next article in that newsgroup (that is,
   the lowest existing article number greater than the current article
   number).  If successful, a response indicating the new current
   article number and the message-id of that article MUST be returned.
   No article text is sent in response to this command.

and an example:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved

From the text I understand that there is something like a "current
article", and when looking at the example, the default "current article"
is the article with the lowest number that is available. Is this
correct?

When I read chapter 6.2.1.  ARTICLE, I don't see anything about
updating what the "current article" is. From this, I get the impression
that only "last" and "next" infuence what must be seen as the
"current article". Is this correct?

Any light on these points is very much appreciated!

(I hope that this is the right group for these questions)

Best regards,

Matto
Re: RFC3977: understanding "last" and "next"
#90061
Author: Julien ÉLIE
Date: Fri, 03 Feb 2023 20:11
80 lines
3990 bytes
Hi Matto,

>        [C] GROUP misc.test
>        [S] 211 1234 3000234 3002322 misc.test
>        [C] NEXT
>        [S] 223 3000237 <668929@example.org> retrieved
>        [C] LAST
>        [S] 223 3000234 <45223423@example.com> retrieved
> 
> From the first example, I get the impression that, when the client
> asked "next", the article 3000237 was the first above 300234, hence
> the server responded with the number and message-ID of this article.
> 
> When the client then asked "last", the server looked at what the
> very first article is below 3000237, and comes with 3000234.
> - Is this correct?

Exactly.



> - Does this mean that the server must keep state, that is,
>    remembering that it answered 3000237 on a previous command?

Indeed, that's the notion of "current article number".
When answering to NEXT, LAST and other commands returning article 
numbers, the current article number is updated to reflect the latest 
article number that has been selected via the use of the command.
The news server keeps that information during the NNTP session (as well 
as the currently selected newsgroup, the rights of the user, etc.).



> From the text I understand that there is something like a "current
> article", and when looking at the example, the default "current article"
> is the article with the lowest number that is available. Is this
> correct?

Yes:

6.1.  Group and Article Selection

    The following commands are used to set the "currently selected
    newsgroup" and the "current article number", which are used by
    various commands.  At the start of an NNTP session, both of these
    values are set to the special value "invalid".



> When I read chapter 6.2.1.  ARTICLE, I don't see anything about
> updating what the "current article" is. From this, I get the impression
> that only "last" and "next" infuence what must be seen as the
> "current article". Is this correct?

6.2.1.  ARTICLE

    Second form (article number specified)
      220 n message-id      Article follows (multi-line)
      412                   No newsgroup selected
      423                   No article with that number

6.2.1.2.  Description

    In the second form, an article number is specified.  If there is an
    article with that number in the currently selected newsgroup, the
    server MUST set the current article number to that number.



> Any light on these points is very much appreciated!
> (I hope that this is the right group for these questions)

You're welcome.

-- 
Julien ÉLIE

« – Ce n'était pas ma question.
   – C'était p'têt pas vot'question, oui, mais c'est ma réponse ! »
     (Georges Marchais répondant à Alain Duhamel)
Re: RFC3977: understanding "last" and "next"
#90063
Author: Jesse Rehmer
Date: Fri, 03 Feb 2023 20:31
13 lines
1487 bytes
On Feb 3, 2023 at 1:53:54 PM CST, "Matto Fransen" <mattof@sdf.org> wrote:

> (I hope that this is the right group for these questions)
> 
> Best regards,
> 
> Matto

This is definitely *the best* place to ask any NNTP protocol related
questions.

I cannot express how invaluable the assistance from folks like Russ, Julien,
and others have been to me over the years.
Re: RFC3977: understanding "last" and "next"
#90073
Author: Matto Fransen
Date: Fri, 03 Feb 2023 21:46
21 lines
1203 bytes
On  3 February 2023 21:11 Julien ÉLIE, wrote:

>> very first article is below 3000237, and comes with 3000234.
>> - Is this correct?
>
> Exactly.
>

8< ---

>
>> Any light on these points is very much appreciated!
>> (I hope that this is the right group for these questions)
>
> You're welcome.

Thank you for your kind reply, it was very helpful !

Best regards,

Matto
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads