[NNTP] [2506] 6xx response codes

Clive D.W. Feather clive at demon.net
Mon Nov 29 01:53:03 PST 2004


Issue: appendix A says that 6xx response codes should be used for new
multi-line responses. Do we do this or drop the appendix?

Ken Murchison said:
> 2506:  I don't see the point of a new 6xx response.  How would a client 
> ever find itself in such a situation?   All existing commands have well 
> defined responses, so the client MUST know when to expect a multi-line 
> response.  If the client gets an unexpected multi-line response, then it 
> probably issued a command that it doesn't support, and gets what it 
> deserves.

You're assuming that the results parsing is tied in tightly with the bit of
code that issues the specific command. In other words, where the pseudo
code is along the lines of:

    sprintf (command, "ARTICLE <%s>", message_id);
    send_command (command);
    switch (get_response_code ())
    {
    case 220:
        while (get_line (buffer), strcmp (buffer, ".") != 0)
        {
            if (buffer [0] == '.')
                append_to_saved_copy (buffer + 1);
            else
                append_to_saved_copy (buffer);
        }
        break;

    case 430: failed (/* no such article */); break;
    case 412:
    case 420:
    case 423: error ("Invalid response code in this context"); break;
    // etc.
    }

then you're right, there's no benefit to this. On the other hand, if you
have a separate module for handling the connection, something like:

    sprintf (command, "ARTICLE <%s>", message_id);
    response = do_command (command, buffer);
    switch (get_response_code ())
    {
    case 220: save_article (message_id, buffer); break;
    case 430: failed (/* no such article */); break;
    case 412:
    case 420:
    case 423: error ("Invalid response code in this context"); break;
    // etc.
    }

then having a predictable protocol is a good idea. This sort of thing,
after all, is why we require all response codes to have a fixed number of
arguments. Allowing client code to distinguish single- and multi-line
responses just from the response code is more of the same.

> I'm in favor or removing Appendix A from the draft.

I can see the viewpoint that says that this horse bolted long ago and this
is just shutting the stable door. So I'm not wedded to keeping it.

Other views?

-- 
Clive D.W. Feather  | Work:  <clive at demon.net>   | Tel:    +44 20 8495 6138
Internet Expert     | Home:  <clive at davros.org>  | Fax:    +44 870 051 9937
Demon Internet      | WWW: http://www.davros.org | Mobile: +44 7973 377646
Thus plc            |                            |



More information about the ietf-nntp mailing list