• RFC3977: understanding "last" and "next"

    From Matto Fransen@21:1/5 to All on Fri Feb 3 20:53:54 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Julien_=c3=89LIE?=@21:1/5 to All on Fri Feb 3 21:11:06 2023
    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)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jesse Rehmer@21:1/5 to Matto Fransen on Fri Feb 3 20:31:59 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matto Fransen@21:1/5 to All on Fri Feb 3 22:46:00 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)