Thread View: news.software.nntp
16 messages
16 total messages
Started by Andrew Gierth
Sat, 26 Feb 2000 00:00
[NNTP Draft] 4. Basic Operation
Author: Andrew Gierth
Date: Sat, 26 Feb 2000 00:00
Date: Sat, 26 Feb 2000 00:00
185 lines
10610 bytes
10610 bytes
[This is one of a series of extracts from draft-ietf-nntpext-base-09.txt
which is available in full from the usual Internet-Draft archives.]
4. Basic Operation.
Every NNTP session MUST involve the following in this order:
CONNECTION
GREETING
DISCONNECTION
Barber [Page 2]
INTERNET DRAFT November 1999
Other steps may occur between the GREETING and DISCONNECTION
step. They are:
CAPABILITIES DISCOVERY
NEWS EXCHANGE
CONCLUSION
NNTP operates over any reliable data stream 8-bit-wide
channel. When running over TCP/IP, the official port for the
NNTP service is 119. Initially, the server host starts the
NNTP service by listening on a TCP port. When a client host
wishes to make use of the service, it MUST establish a TCP
connection with the server host by connecting to that host on
the same port on which the server is listening. This is the
CONNECTION step. When the connection is established, the NNTP
server host MUST send a greeting. This is the GREETING step.
The client host and server host SHOULD then exchange commands
and responses (respectively) until the connection is closed or
aborted. This final step is called the DISCONNECTION step.
If there is a CONCLUSION step, it MUST immediately precede the
DISCONNECTION step. There MUST be only one CONNECTION,
CONCLUSION and DISCONNECTION step for each NNTP session. All
other steps MAY be repeated as needed.
The character set for all NNTP commands is UTF-8. Commands in
the NNTP MUST consist of an US-ASCII case-insensitive keyword,
which MAY be followed by one or more arguments. An US-ASCII
CRLF pair MUST terminate all commands. Multiple commands MUST
NOT be on the same line. Keywords MUST consist of printable
US-ASCII characters. Unless otherwise noted elsewhere in this
document, arguments SHOULD consist of printable US-ASCII
characters. Keywords and arguments MUST be each separated by
one or more US-ASCII SPACE or US-ASCII TAB characters.
Keywords MUST be at least three US-ASCII characters and MUST
NOT exceed 12 US-ASCII characters. Command lines MUST NOT
exceed 512 octets, which includes the terminating US-ASCII
CRLF pair. Arguments MUST NOT exceed 497 octets.
Each response MUST start with a three-digit response code that
is sufficient to distinguish all responses. Unless
specifically specified as one of the valid responses for a
command (such as those described later in this document), each
response is contained in a single line. However, certain
commands MAY permit multi-line responses. All multi-line
responses MUST adhere to the following format: After sending
the first line of the response and an US-ASCII CRLF, any
additional lines are sent, each terminated by an US-ASCII CRLF
pair. When all lines of the response have been sent, a final
line MUST be sent, consisting of a termination octet (US-ASCII
decimal code 046, ".") and an US-ASCII CRLF pair. If any line
of the multi-line response begins with the termination octet,
the line MUST be "byte-stuffed" by pre-pending the termination
Barber [Page 3]
INTERNET DRAFT November 1999
octet to that line of the response. Hence, a multi-line
response is terminated with the five octets "CRLF.CRLF" (in
US-ASCII). When examining a multi-line response, the client
MUST check to see if the line begins with the termination
octet. If so and if octets other than US-ASCII CRLF follow,
the first octet of the line (the termination octet) MUST be
stripped away. If so and if US-ASCII CRLF immediately follows
the termination character, then the response from the NNTP
server is ended and the line containing ".CRLF" (in US-ASCII)
MUST NOT considered part of the multi-line response. The
keywords that support multi-line responses have the format of
those responses described in the responses section.
A NNTP server MAY have an inactivity autologout timer. Such a
timer MUST be of at least three minutes duration. The receipt
of any command from the client during that interval 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.
4.1 Response Codes
Each response MUST begin with a three-digit status indicator.
These are status reports from the server and indicate the
response to the last command received from the client.
The first digit of the response broadly indicates the success,
failure, or progress of the previous command.
1xx - Informative message
2xx - Command ok
3xx - Command ok so far, send the rest of it.
4xx - Command was correct, but couldn't be performed for some
reason.
5xx - Command unimplemented, or incorrect, or a serious
program error occurred.
The next digit in the code indicates the function response
category.
x0x - Connection, setup, and miscellaneous messages
x1x - Newsgroup selection
x2x - Article selection
x3x - Distribution functions
x4x - Posting
x8x - Nonstandard (private implementation) extensions
x9x - Debugging output
The exact response codes that can be returned in response to a
given command are detailed in the description of the keyword
that is the first part of the command. In addition, below is
listed a general set of response codes that MAY be received at
any time.
Barber [Page 4]
INTERNET DRAFT November 1999
Certain response codes contain parameters such as numbers and
names in addition to the status indicator. In those cases, the
number and type of such parameters MUST be fixed for each
response code to simplify interpretation of the response. In
all other cases, the client MUST only use the status indicator
itself to determine the nature of the response.
Parameters MUST be separated from the numeric status indicator
and from each other by a single US-ASCII space. All numeric
parameters MUST be in base 10 (decimal) format, and may have
leading zeros. All string parameters MUST begin after the
separating space, and MUST end before the following separating
space or the US-ASCII CRLF pair at the end of the line.
(Therefore, string parameters MUST NOT contain US-ASCII
spaces.) All text, if any, in the response which is not a
parameter of the response must follow and be separated from
the last parameter by an US-ASCII space. Also, note that the
text following a response number may vary in different
implementations of the server. The 3-digit numeric status
indicator should be used to determine what response was sent.
Response codes not specified in this standard MAY be used for
any installation-specific additional commands also not
specified. These SHOULD be chosen to fit the pattern of x8x
specified above. (Note that debugging is provided for
explicitly in the x9x response codes.)
The use of unspecified response codes for a standard command
is prohibited.
The status indicator pattern x9x is provided for debugging.
Since much debugging output may be classed as "informative
messages", it MUST be the case that responses 190 through 199
WILL be used for various debugging outputs. There is no
requirement in this specification for debugging output.
However, if such is provided over the connected stream, it
MUST use these response codes. If appropriate to a specific
implementation, other x9x codes MAY be used for debugging.
(For example, response code 290 could be used to acknowledge a
remote debugging request.)
A server MUST respond to an unrecognized, unimplemented, or
syntactically invalid command with a negative response
code(status indicators of the form 5XX). A server MUST
respond to a command issued when the session is in an
incorrect state by responding with a negative status
indicator. This may be from either the 4XX or 5XX group as
appropriate.
--
Andrew.
Re: [NNTP Draft] 4. Basic Operation
Author: Russ Allbery
Date: Sat, 26 Feb 2000 00:00
Date: Sat, 26 Feb 2000 00:00
16 lines
1475 bytes
1475 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> writes: > This situation is, IMO, too badly broken to fix. Looking through the > current responses (see below), there is even inconsistency on the > presence or absence of parameters on some common response codes. The specified return codes for NNTP, particularly with the various private extension ones tacked on, are a complete and utter disaster. I took a look at cleaning up the relevant header in INN at one point and mostly gave up because I couldn't even figure out any usable grouping of return codes for the naming of symbolic constants. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: [NNTP Draft] 4. Basic Operation
Author: Russ Allbery
Date: Sat, 26 Feb 2000 00:00
Date: Sat, 26 Feb 2000 00:00
14 lines
1190 bytes
1190 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> writes: > NNTP operates over any reliable data stream 8-bit-wide > channel. When running over TCP/IP, the official port for the > NNTP service is 119. This would be the place to establish an alternate canonical port for feeds if we want to try to do that. I know a number of sites that are already doing this using a variety of choices of port. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: [NNTP Draft] 4. Basic Operation
Author: Andrew Gierth
Date: Sat, 26 Feb 2000 00:00
Date: Sat, 26 Feb 2000 00:00
69 lines
4245 bytes
4245 bytes
> NNTP operates over any reliable data stream 8-bit-wide > channel. When running over TCP/IP, the official port for the > NNTP service is 119. Initially, the server host starts the > NNTP service by listening on a TCP port. When a client host > wishes to make use of the service, it MUST establish a TCP > connection with the server host by connecting to that host on > the same port on which the server is listening. This is the > CONNECTION step. When the connection is established, the NNTP > server host MUST send a greeting. This is the GREETING step. > The client host and server host SHOULD then exchange commands > and responses (respectively) until the connection is closed or > aborted. This final step is called the DISCONNECTION step. The issue of pipelining was suggested to be added to this section by Clive Feather; the comments on the mailing list were along the lines of "yes, if currently deployed software handles it OK, we should require that it work". One client was mentioned that required it to work. > Each response MUST begin with a three-digit status indicator. > These are status reports from the server and indicate the > response to the last command received from the client. > The first digit of the response broadly indicates the success, > failure, or progress of the previous command. > 1xx - Informative message > 2xx - Command ok > 3xx - Command ok so far, send the rest of it. > 4xx - Command was correct, but couldn't be performed for some > reason. > 5xx - Command unimplemented, or incorrect, or a serious > program error occurred. > The next digit in the code indicates the function response > category. > x0x - Connection, setup, and miscellaneous messages > x1x - Newsgroup selection > x2x - Article selection > x3x - Distribution functions > x4x - Posting > x8x - Nonstandard (private implementation) extensions > x9x - Debugging output The x8x entry here is the sticking point for progressing the AUTHINFO extensions. Are there any known cases of x9x codes actually being used for debugging or any other purpose? > The status indicator pattern x9x is provided for debugging. > Since much debugging output may be classed as "informative > messages", it MUST be the case that responses 190 through 199 > WILL be used for various debugging outputs. There is no > requirement in this specification for debugging output. > However, if such is provided over the connected stream, it > MUST use these response codes. If appropriate to a specific > implementation, other x9x codes MAY be used for debugging. > (For example, response code 290 could be used to acknowledge a > remote debugging request.) This wording makes it completely unclear what the client should actually _do_ with a 19x response. -- Andrew.
Re: [NNTP Draft] 4. Basic Operation
Author: Curt Welch
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
50 lines
3301 bytes
3301 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: > Pete> If not, does it sound reasonable to allow the client the option > Pete> of not discarding the termination octet if it's not followed by > Pete> either a second termination octet or a CR/LF pair? > > Provided that there is still a 'MUST NOT' restriction on _generating_ > such malformed lines, it seems reasonable to allow the flexibility to > interpret them correctly regardless. That's the type of hack that I think is fine for a server author to put into his code to try and deal with real-world problems. But I would strongly argue that we should not put that into the RFC as an OK thing to do. Servers MUST delete ALL leading DOTS not followed but A CRLF. If you put that hack in your server, then you are violating the RFC. But that's fine - all servers violate the RFC in minor places like that. For example, my server accepts Message-Ids with spaces in them as arguments to an IHAVE command. As in: IHAVE <crap with spaces@bogus.server.com> By the RFC, I MUST reject that with a 5xx message for being a syntactically invalid command (3 arguments instead of one). Instead, I parse it as the sending system intended (as per 1036 Message-IDs BTW), and then reject the offer because of an invalid Message-ID. As I recall, Diablo got confused when I rejected that with a 5xx code and I think it keept re-offering the article to me. But I forget the exact details here. This is actually an issue that might deserve mention in the IHAVE and TAKETHIS commands. You don't want those broken newsreaderes to work on _MOST_ servers. You want it to break on the server that the newsreader author users so instead of thinking it's OK, he fixes the code to follow the RFC. In addition, your hack doesn't even solve the problem for the newsreader. It only reduces the probability further (further hiding the bug from the author). Not only is it possible for the first character of the last line to be a ., but if the data is correct, the second character may be a dot as well, and you hack won't catch it in that case. Do do a good job there, you have to basically do full UUDECOD parsing to make a "really good" guess as to whether the hack applies to the line or not. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: [NNTP Draft] 4. Basic Operation
Author: Andrew Gierth
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
132 lines
6621 bytes
6621 bytes
>>>>> "Curt" == Curt Welch <curt@kcwc.com> writes: >> 4. Basic Operation. >> Command lines MUST NOT exceed 512 octets, which includes the >> terminating US-ASCII CRLF pair. Arguments MUST NOT exceed 497 >> octets. Curt> I've seen Message-IDs defined to be a max of 512 octets. Where? USEFOR doesn't give a limit, though I think it probably should. Curt> How then is NNTP supposed to implement a "ARTICLE <MID>" Curt> command if the max command length is limited to 512? MIDs should not ever be that long. Personally I restrict 'em by enforcing the NNTP command length limit strictly. (Helps to avoid buffer overrun issues, too.) Curt> Why not just rase this to something more resonable like 1000? Because that would be a gratuitous incompatibility with RFC 977? >> A NNTP server MAY have an inactivity autologout timer. Such a >> timer MUST be of at least three minutes duration. The >> receipt of any command from the client during that interval >> 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. Curt> This is a change from past implementations which dumped a 503 Curt> timeout message into the stream before closing it. I believe the clarification is intentional. Sending an out-of-sequence response is not, IMO, appropriate. Curt> But, because this used to be common practice, I think it should Curt> be mentioned in the RFC to assist people writing clients. You mean that the RFC should state that sending a response before closing was common, but is now forbidden? I guess a compatibility note of some sort might be in order. >> keyword that is the first part of the command. In addition, >> below is listed a general set of response codes that MAY be >> received at any time. Curt> I don't really understand where there list is? Nor does anyone else, apparently. >> The use of unspecified response codes for a standard command is >> prohibited. Curt> I think this is a problem because when you write a server, you Curt> will always find error conditions that are unique to your Curt> impelementation. And most commands don't have a generic "other Curt> error" code defined. So you end up either sending a code not Curt> defined for the command, in direct violation to the above, or Curt> you use one of the other codes that seems to be a "close" fit. Curt> But by overloading the code, you make it impossible for a Curt> client to tell the difference between the errors. Or worse, Curt> the client mis-interprets the meaning of the error and does Curt> something stupid. The PAT example could be considered to fall into this category. >> The status indicator pattern x9x is provided for debugging. >> Since much debugging output may be classed as "informative >> messages", it MUST be the case that responses 190 through 199 >> WILL be used for various debugging outputs. There is no >> requirement in this specification for debugging output. >> However, if such is provided over the connected stream, it >> MUST use these response codes. If appropriate to a specific >> implementation, other x9x codes MAY be used for debugging. >> (For example, response code 290 could be used to acknowledge >> a remote debugging request.) Curt> What's the point of this x9x stuff? Is it trying to say that a Curt> client may see random extra unexpected lines with x9x codes and Curt> that they should be ignored as if they weren't there? (almost Curt> as if they were comments?) Curt> Or is it saying that any command might return a x9x code Curt> instead of one of the expected codes? Curt> Or is it only saying that if you add private debugging Curt> commands, that their responses must be from the x9x set. And Curt> if that's the point, what's the difference between a private Curt> extension (x8x) and a debugging command? And since all this Curt> has no bearing whatsoever on makeing "real" clients work, why Curt> does the RFC go to all this trouble to define the x8x and x9x Curt> codes? Good question. This has already been brought up on the list, as far as I know the x8x and x9x codes have never been defended other than by reference to the fact that RFC 977 defined them that way (and was equally ambiguous about them, in fact the paragraph in question is straight from 977). Personally I don't see any reasonable way to resolve this other than to remove the special meanings of x8x and x9x completely; x8x is needed for authentication anyway, and x9x could simply be reassigned as 'reserved'. >> A server MUST respond to an unrecognized, unimplemented, or >> syntactically invalid command with a negative response >> code(status indicators of the form 5XX). A server MUST >> respond to a command issued when the session is in an >> incorrect state by responding with a negative status >> indicator. This may be from either the 4XX or 5XX group as >> appropriate. Curt> Are these codes that can be received at any time? i.e. is it Curt> OK to send any 4xx or 5xx code as a response to any command? Curt> I think it would probably be wise to more precisely define what Curt> a server MUST return for a few cases like "command unknown". Curt> Or "Other error". Or at least talk a little more about how to Curt> correctly pick codes. RFC 977 had this a little bit better, I think. A list of error codes, as 977 has, would probably help to clarify things a great deal, and expose some inconsistencies in the draft (such as the misuse of 500 in a few places). -- Andrew.
Re: [NNTP Draft] 4. Basic Operation
Author: Andrew Gierth
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
119 lines
6606 bytes
6606 bytes
>>>>> "Curt" == Curt Welch <curt@kcwc.com> writes: Curt> I'm thinking this table of xNx codes should just be dropped Curt> from the standard. That would help solve the AUTHINFO problem. Curt> Does any client ever written analyze codes based on the second Curt> digit? not that I know of - but that isn't saying much. Curt> Something that should have been done, but wasn't, would be to Curt> reserver a class of codes which means: "data follows". For Curt> example, if all the 2xx codes were used for responses that Curt> preceeded data. That way, low level routines could correctly Curt> parse the data stream even if they weren't expecting to see Curt> data from the command. Curt> Has 3xx been used only for those places where data needs to be Curt> sent by the client (i.e. multiline data). That would help if Curt> it were the case. Even that isn't the case in practice; AUTHINFO USER returns 381, but doesn't expect a multiline response from the client. This situation is, IMO, too badly broken to fix. Looking through the current responses (see below), there is even inconsistency on the presence or absence of parameters on some common response codes. Curt> I'm thinking it might make sense to throw out these current Nxx Curt> and xNx meanings and see if we can create some new definitions Curt> that would be more useful. This of course requires trying to Curt> track down almost every response code currently in use and Curt> track down how every newsreadser written checks codes. I'm Curt> thinking this might not be as hard as it sounds. But even if Curt> we do some serious research in this direction, we may find it's Curt> just to late to "fix" this... Curt> But some things, like dropping x8x and x9x may be doable. This is a list of all the main error codes that I know of (taken from some code of mine from a year or so back, and compiled from RFC 977 and various other sources): RC( Rc_HELP_OK, 100, "help follows" ) RC( Rc_DATE_OK, 111, "%04d%02d%02d%02d%02d%02d" ) RC( Rc_READY_POSTOK, 200, "%s server ready - posting allowed" ) RC( Rc_READY_NOPOST, 201, "%s server ready - no posting allowed" ) RC( Rc_SLAVE_OK, 202, "slave status noted (deprec)" ) RC( Rc_STREAM_OK, 203, "StreamOK" ) RC( Rc_GOODBYE, 205, "closing connection - goodbye!" ) RC( Rc_GROUP_OK, 211, "%d %d %d %s group selected" ) RC( Rc_LIST_OK, 215, "list follows" ) RC( Rc_ARTICLE_OK, 220, "%d %s article retrieved - head and body follow" ) RC( Rc_HEAD_OK, 221, "%d %s article retrieved - head follows" ) RC( Rc_BODY_OK, 222, "%d %s article retrieved - body follows" ) RC( Rc_STAT_OK, 223, "%d %s article retrieved - request text separately" ) RC( Rc_XOVER_OK, 224, "overview follows" ) RC( Rc_NEWNEWS_OK, 230, "list of new articles by message-id follows" ) RC( Rc_NEWGROUPS_OK, 231, "list of new newsgroups follows" ) RC( Rc_IHAVE_OK, 235, "article transferred ok" ) RC( Rc_CHECK_OK, 238, "%s" ) RC( Rc_TAKETHIS_OK, 239, "%s" ) RC( Rc_POST_OK, 240, "article posted ok" ) RC( Rc_AUTH_OK, 281, "authentication succeeded" ) RC( Rc_IHAVE_PROCEED, 335, "send article to be transferred." ) RC( Rc_POST_PROCEED, 340, "send article to be posted." ) RC( Rc_AUTH_PROCEED, 381, "more authentication required" ) RC( Rc_SERVER_UNAVAIL, 400, "service discontinued" ) RC( Rc_NO_SUCH_GROUP, 411, "no such news group" ) RC( Rc_NOT_IN_GROUP, 412, "no newsgroup has been selected" ) RC( Rc_NO_CURRENT_ART, 420, "no current article has been selected" ) RC( Rc_NO_NEXT_ART, 421, "no next article in this group" ) RC( Rc_NO_PREV_ART, 422, "no previous article in this group" ) RC( Rc_NO_SUCH_ARTNUM, 423, "no such article number in this group" ) RC( Rc_NO_SUCH_ARTICLE, 430, "no such article found" ) RC( Rc_CHECK_DEFER, 431, "%s" ) RC( Rc_IHAVE_REFUSE, 435, "article not wanted - do not send it" ) RC( Rc_IHAVE_DEFER, 436, "transfer failed - try again later" ) RC( Rc_IHAVE_REJECT, 437, "article rejected - do not try again." ) RC( Rc_CHECK_REFUSE, 438, "%s" ) RC( Rc_TAKETHIS_REJECT, 439, "%s" ) RC( Rc_POST_DENIED, 440, "posting not allowed" ) RC( Rc_POST_FAILED, 441, "posting failed" ) RC( Rc_AUTH_NEEDED, 480, "authentication required" ) RC( Rc_AUTH_FAILED, 482, "authentication failed" ) RC( Rc_BAD_COMMAND, 500, "command not recognized" ) RC( Rc_SYNTAX_ERROR, 501, "command syntax error" ) RC( Rc_ACCESS_DENIED, 502, "you do not have permission to talk" ) RC( Rc_SERVER_FAULT, 503, "program fault - command not performed" ) In addition to the above: INN sends 481 not 482 in response to bad AUTHINFO from a feed peer (482 is used for bad auth from a reader) INN uses 504 for "server too busy" and 505 for "client making too many connects". I think the implication of the new draft is that 400 should have been used instead. ANU News (and INN) use 282 and 481 for good and bad responses to the XGTITLE command. This command is deprecated (LIST NEWSGROUPS replaces it). INN uses 339 for "continue to send batch" for the XBATCH extension (and 239 on success, and 436 on failure) XHDR and XPAT return 221 on success without the parameters normally supplied on a 221 response. LISTGROUP returns 211 (same as GROUP) but without the parameter values normally returned by GROUP. INN uses 223 followed by a list of pathnames (without the normal parameters returned with 223) for the XPATH command. -- Andrew.
Re: [NNTP Draft] 4. Basic Operation
Author: Curt Welch
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
100 lines
5685 bytes
5685 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: > 4. Basic Operation. > Command lines MUST NOT exceed 512 octets, which includes the > terminating US-ASCII CRLF pair. Arguments MUST NOT exceed 497 > octets. I've seen Message-IDs defined to be a max of 512 octets. How then is NNTP supposed to implement a "ARTICLE <MID>" command if the max command length is limited to 512? Why not just rase this to something more resonable like 1000? > A NNTP server MAY have an inactivity autologout timer. Such a > timer MUST be of at least three minutes duration. The > receipt of any command from the client during that interval > 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. This is a change from past implementations which dumped a 503 timeout message into the stream before closing it. I think not dummping the response is good because no client will mis-interpret the meaning of a closed connection whereas they may mis-interpret the 503 code (thinking it was the response to a command which was actually sent after the timeout). But, because this used to be common practice, I think it should be mentioned in the RFC to assist people writing clients. > 4.1 Response Codes > keyword that is the first part of the command. In addition, > below is listed a general set of response codes that MAY be > received at any time. I don't really understand where there list is? > The use of unspecified response codes for a standard command > is prohibited. I think this is a problem because when you write a server, you will always find error conditions that are unique to your impelementation. And most commands don't have a generic "other error" code defined. So you end up either sending a code not defined for the command, in direct violation to the above, or you use one of the other codes that seems to be a "close" fit. But by overloading the code, you make it impossible for a client to tell the difference between the errors. Or worse, the client mis-interprets the meaning of the error and does something stupid. > The status indicator pattern x9x is provided for debugging. > Since much debugging output may be classed as "informative > messages", it MUST be the case that responses 190 through 199 > WILL be used for various debugging outputs. There is no > requirement in this specification for debugging output. > However, if such is provided over the connected stream, it > MUST use these response codes. If appropriate to a specific > implementation, other x9x codes MAY be used for debugging. > (For example, response code 290 could be used to acknowledge > a remote debugging request.) What's the point of this x9x stuff? Is it trying to say that a client may see random extra unexpected lines with x9x codes and that they should be ignored as if they weren't there? (almost as if they were comments?) Or is it saying that any command might return a x9x code instead of one of the expected codes? Or is it only saying that if you add private debugging commands, that their responses must be from the x9x set. And if that's the point, what's the difference between a private extension (x8x) and a debugging command? And since all this has no bearing whatsoever on makeing "real" clients work, why does the RFC go to all this trouble to define the x8x and x9x codes? Are these part of the codes that MAY be received at any time mentioned above? Or what? I've never understood this section and in general, I've just ignored it :). > A server MUST respond to an unrecognized, unimplemented, or > syntactically invalid command with a negative response > code(status indicators of the form 5XX). A server MUST > respond to a command issued when the session is in an > incorrect state by responding with a negative status > indicator. This may be from either the 4XX or 5XX group as > appropriate. Are these codes that can be received at any time? i.e. is it OK to send any 4xx or 5xx code as a response to any command? I think it would probably be wise to more precisely define what a server MUST return for a few cases like "command unknown". Or "Other error". Or at least talk a little more about how to correctly pick codes. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: [NNTP Draft] 4. Basic Operation
Author: Curt Welch
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
132 lines
6535 bytes
6535 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: > >>>>> "Curt" == Curt Welch <curt@kcwc.com> writes: > Curt> I've seen Message-IDs defined to be a max of 512 octets. > > Where? USEFOR doesn't give a limit, though I think it probably should. I checked 1036, and it makes no mention of limits. Son of 1036 says: Message IDs MUST be no longer than 250 octets, including the "<" and ">". and also: The length limit is undesirable, but is present in widely-used existing software. The limit is actually 255, but a small safety margin is wise. That sounds to me like it was specified somewhere else and just copied into son-of-1036. Maybe 822? So maybe I just rememberd the wrong power of two? And the NNTP 512 limit isn't an issue? I've certainly never seen a case in real-life were it was ever close to being a problem. And anyone who generates message-IDs longer than 80 characters deservs to have something cut off anyway :). I'm mostly against length limits in these standards, but the Message-ID is one place where I think there should be a length limit. And 250 sounds good to me. > Curt> How then is NNTP supposed to implement a "ARTICLE <MID>" > Curt> command if the max command length is limited to 512? > > MIDs should not ever be that long. Personally I restrict 'em by > enforcing the NNTP command length limit strictly. (Helps to avoid > buffer overrun issues, too.) > > Curt> Why not just rase this to something more reasonable like 1000? > > Because that would be a gratuitous incompatibility with RFC 977? Thinking about the line lentgh limit a bit more, it seems to me that what's more important than setting a limit in the RFC, is clearly defining what a client can expect to have happen if it sends a command line which is too long for the server (no matter what the length happens to be.). Checking my code, I find I return a "400 command too long" result. Don't know why I picked 400 -- it may have come from some other server or I might just have made it up. It should be in the 5xx range (if not the 6xx :) because it's a really bad error). This is an example of a place where a code should be allocated for this error, and not used for any other response. I also think it would be useful to include wording that required the NNTP server to correctly read the entire line even if it was too long. I.e. spliting it up and trying to parse it as two or more commands would not be allowed. This way, the client would not be required to length check all the commands before they were sent as long as it could deal with the LINE TOO LONG response code in a reasonable way for all commands. > You mean that the RFC should state that sending a response before > closing was common, but is now forbidden? Right. And include the 503 number as well. That should be in the list of commands that could be received as a response to any command with a note that cleary states servers are now forbidden to send it but it was common in some older servers. If you assign new response codes in the future that could be a valid response to any command, you want to avoid common numbers like that which were used in the past, so it's good that the number lives on for a while in the current RFC. > I guess a compatibility note of some sort might be in order. It helps client authors get into the right frame of mind when writing the code. It means that for those old servers, if you don't (or can't - as the case with some socket interfaces) check the status of the read side of the connection before sending a command, you may find what looks like a 503 response to any command. It would also be wise to explicity declare that 503 could NEVER be sent by a server for any reason in this version of the RFC. > >> keyword that is the first part of the command. In addition, > >> below is listed a general set of response codes that MAY be > >> received at any time. > > Curt> I don't really understand where there list is? > > Nor does anyone else, apparently. There should be a list however, and it should include things like the 503 and some new code for "LINE TO LONG", as well as others like the 480 authentication required. > >> A server MUST respond to an unrecognized, unimplemented, or > >> syntactically invalid command with a negative response > >> code(status indicators of the form 5XX). A server MUST > >> respond to a command issued when the session is in an > >> incorrect state by responding with a negative status > >> indicator. This may be from either the 4XX or 5XX group as > >> appropriate. > > Curt> Are these codes that can be received at any time? i.e. is it > Curt> OK to send any 4xx or 5xx code as a response to any command? > > Curt> I think it would probably be wise to more precisely define what > Curt> a server MUST return for a few cases like "command unknown". > Curt> Or "Other error". Or at least talk a little more about how to > Curt> correctly pick codes. > > RFC 977 had this a little bit better, I think. > > A list of error codes, as 977 has, would probably help to clarify > things a great deal, and expose some inconsistencies in the draft > (such as the misuse of 500 in a few places). It seems to me that the bigest single issue with the RFC is all centered around the use of error codes. Nothing else about the RFC bothers me as much as that does -- both as a server author and as a client author. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: [NNTP Draft] 4. Basic Operation
Author: Shalmaneser
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
20 lines
1476 bytes
1476 bytes
Curt Welch wrote: > Son of 1036 says: [...] > The length limit is undesirable, but is present in widely-used > existing software. The limit is actually 255, but a small safety > margin is wise. > > That sounds to me like it was specified somewhere else and just copied > into son-of-1036. Maybe 822? It probably comes from this, in dbz.h: /* * In principle we could handle unlimited-length keys by operating a chunk * at a time, but it's not worth it in practice. Setting a nice large * bound on them simplifies the code and doesn't hurt anything. */ #define DBZMAXKEY 255
Re: [NNTP Draft] 4. Basic Operation
Author: Curt Welch
Date: Sun, 27 Feb 2000 00:00
Date: Sun, 27 Feb 2000 00:00
70 lines
3987 bytes
3987 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: > > The first digit of the response broadly indicates the > > success, failure, or progress of the previous command. > > > 1xx - Informative message > > 2xx - Command ok > > 3xx - Command ok so far, send the rest of it. > > 4xx - Command was correct, but couldn't be performed for > > some > > reason. > > 5xx - Command unimplemented, or incorrect, or a serious > > program error occurred. Please add a blank line here :). > > The next digit in the code indicates the function response > > category. > > > x0x - Connection, setup, and miscellaneous messages > > x1x - Newsgroup selection > > x2x - Article selection > > x3x - Distribution functions > > x4x - Posting > > x8x - Nonstandard (private implementation) extensions > > x9x - Debugging output > > The x8x entry here is the sticking point for progressing the AUTHINFO > extensions. I'm thinking this table of xNx codes should just be dropped from the standard. That would help solve the AUTHINFO problem. Does any client ever written analyze codes based on the second digit? What's the advantage for trying to reserve them in this fashion now? When you talk about return codes from a specific command, it makes no difference whatsoever how the codes are selected, or if they duplicate codes returned from other commands. All commands could for example just use the values 001, 002, 003, and 004, and the protocol will work fine. What's important, is if there are codes, or classes of codes, which might be returned for all commands, or might have _useful_ meaning for all commands. For example, the AUTHINFO 480 authentication requried code. Or the fact that 4xx and 5xx are always error responses. Something that should have been done, but wasn't, would be to reserver a class of codes which means: "data follows". For example, if all the 2xx codes were used for responses that preceeded data. That way, low level routines could correctly parse the data stream even if they weren't expecting to see data from the command. Has 3xx been used only for those places where data needs to be sent by the client (i.e. multiline data). That would help if it were the case. I'm thinking it might make sense to throw out these current Nxx and xNx meanings and see if we can create some new definitions that would be more useful. This of course requires trying to track down almost every response code currently in use and track down how every newsreadser written checks codes. I'm thinking this might not be as hard as it sounds. But even if we do some serious research in this direction, we may find it's just to late to "fix" this... But some things, like dropping x8x and x9x may be doable. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: [NNTP Draft] 4. Basic Operation
Author: Curt Welch
Date: Mon, 28 Feb 2000 00:00
Date: Mon, 28 Feb 2000 00:00
71 lines
4163 bytes
4163 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
> I think the server should have some flexibility here. In particular it
> should have the option to drop the connection if it sees a lot of
> consecutive bad commands - this usually means that something has got
> its commands & data out of step somehow.
That sounds like a resonable thing for a server to do -- i.e drop
on a large string of bad commands. But I don't know if we need to
say anything about that in the RFC. Do you see something that makes
you feel you should shouldn't add to to a server in the RFC?
To me, if you write TCP/IP code, you just have to assume that the
connection might drop at any time for any reason and be prepared to
deal with that. So a server which decides to "make" it happen when
things get "really" bad, isn't causing the client any probelms it
shouldn't already be set up to deal with.
> Curt> This is an example of a place where a code should be allocated
> Curt> for this error, and not used for any other response.
>
> Why?
> If a server wants to support command lines >512, that is an extension,
> and should be handled via the LIST EXTENSIONS mechanism.
Well, I guess I take back what I was thinking here. Unlike say
article lines, NNTP command lines mostly will never have a length
problem. So fixing the limit at 512 and just being done with it
is probably fine.
Where I was comming from was more along the lines of what a client may
want to for articles. Like, for example, a client may not want to
fold Path: lines, but if it got a clear "Path too long" response from
a POST (it could "fix" the lines and then post it).
Speaking of article lines. Does the RFC say anything about line
lengths within multiline data? I know this was a problem in the past
in that some NNTP implementations tried to apply the 512 length not
just to commands, but to article lines as well.
I'm thinking the RFC needs to defer to USEFOR for the requirements
for the article format, and make it clear that the COMMAND line length
limit has nothing to do with article lines.
> Curt> I also think it would be useful to include wording that
> Curt> required the NNTP server to correctly read the entire line even
> Curt> if it was too long. I.e. spliting it up and trying to parse
> Curt> it as two or more commands would not be allowed. This way, the
> Curt> client would not be required to length check all the commands
> Curt> before they were sent as long as it could deal with the LINE
> Curt> TOO LONG response code in a reasonable way for all commands.
>
> The client can't do this at present, so there seems little gain in
> trying to add this functionality.
Yeah, and it's not really needed so what's the point...
> Curt> It would also be wise to explicity declare that 503 could NEVER
> Curt> be sent by a server for any reason in this version of the RFC.
>
> 503 is a valid response ("program fault - command not performed")
> under other circumstances besides a timeout.
Well, it would have been wise :).
--
Curt Welch http://CurtWelch.Com/
curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: [NNTP Draft] 4. Basic Operation
Author: Curt Welch
Date: Mon, 28 Feb 2000 00:00
Date: Mon, 28 Feb 2000 00:00
21 lines
1526 bytes
1526 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> [Curt Welch]
>
> > > Yes, I think 433 should be mentioned here. It has been reserved at
> > > IANA for this use ("NNSP").
> >
> > What does S stand for?
>
> I think it's just "Server", but it is unclear.
That's what I guessed.
So, use use the Network News Server Protocol for transporting articles and
the Network News Transport Protocol for servering articles. Sounds good
to me. :)
--
Curt Welch http://CurtWelch.Com/
curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: [NNTP Draft] 4. Basic Operation
Author: Kjetil Torgrim Homme
Date: Mon, 28 Feb 2000 00:00
Date: Mon, 28 Feb 2000 00:00
25 lines
1650 bytes
1650 bytes
[Curt Welch]
> > Yes, I think 433 should be mentioned here. It has been reserved at
> > IANA for this use ("NNSP").
>
> What does S stand for?
I think it's just "Server", but it is unclear.
> Part of the problem of mentioning it here is that you may feel the
> need to get sucked into a formal definiton of the prtocol as it
> exists on that port. But I suspect we should try to do both.
> Maybe just a few words about how it's an alternate port that MAY
> support the full NNTP protcol but is intended primarially for use
> with feeding news (and then list those commands).
>
> And maybe some words that say any NNTP client used to feed news
> MUST have an option to send to port 433 as well as 119?
Sounds good.
Kjetil T.
Re: [NNTP Draft] 4. Basic Operation
Author: Andrew Gierth
Date: Mon, 28 Feb 2000 00:00
Date: Mon, 28 Feb 2000 00:00
59 lines
3543 bytes
3543 bytes
>>>>> "Curt" == Curt Welch <curt@kcwc.com> writes:
Curt> And the NNTP 512 limit isn't an issue? I've certainly never
Curt> seen a case in real-life were it was ever close to being a
Curt> problem.
The only situation I know of where it is an issue is when providing long
lists of group names or patterns to the NEWNEWS command.
Curt> Thinking about the line lentgh limit a bit more, it seems to me
Curt> that what's more important than setting a limit in the RFC, is
Curt> clearly defining what a client can expect to have happen if it
Curt> sends a command line which is too long for the server (no
Curt> matter what the length happens to be.).
Curt> Checking my code, I find I return a "400 command too long"
Curt> result. Don't know why I picked 400 -- it may have come from
Curt> some other server or I might just have made it up. It should
Curt> be in the 5xx range (if not the 6xx :) because it's a really
Curt> bad error).
Not all of my code handles this the same way. In one case I ended up
eating the entire line, no matter how long, and responding with
"500 Line too long". In another case I ended up dropping the connection.
I think the server should have some flexibility here. In particular it
should have the option to drop the connection if it sees a lot of
consecutive bad commands - this usually means that something has got
its commands & data out of step somehow.
Curt> This is an example of a place where a code should be allocated
Curt> for this error, and not used for any other response.
Why?
If a server wants to support command lines >512, that is an extension,
and should be handled via the LIST EXTENSIONS mechanism.
Curt> I also think it would be useful to include wording that
Curt> required the NNTP server to correctly read the entire line even
Curt> if it was too long. I.e. spliting it up and trying to parse
Curt> it as two or more commands would not be allowed. This way, the
Curt> client would not be required to length check all the commands
Curt> before they were sent as long as it could deal with the LINE
Curt> TOO LONG response code in a reasonable way for all commands.
The client can't do this at present, so there seems little gain in
trying to add this functionality.
Curt> It would also be wise to explicity declare that 503 could NEVER
Curt> be sent by a server for any reason in this version of the RFC.
503 is a valid response ("program fault - command not performed")
under other circumstances besides a timeout.
--
Andrew.
Re: [NNTP Draft] 4. Basic Operation
Author: Kai Henningsen
Date: Sun, 05 Mar 2000 00:00
Date: Sun, 05 Mar 2000 00:00
27 lines
1871 bytes
1871 bytes
kjetilho@haey.ifi.uio.no (Kjetil Torgrim Homme) wrote on 27.02.00 in <1rzosn56ud.fsf@haey.ifi.uio.no>:
> [Russ Allbery]
>
> > Andrew Gierth <andrew@erlenstar.demon.co.uk> writes:
> >
> > > NNTP operates over any reliable data stream 8-bit-wide
> > > channel. When running over TCP/IP, the official port for
> > > the NNTP service is 119.
> >
> > This would be the place to establish an alternate canonical port
> > for feeds if we want to try to do that. I know a number of sites
> > that are already doing this using a variety of choices of port.
>
> Yes, I think 433 should be mentioned here. It has been reserved at
> IANA for this use ("NNSP").
Registration credited to one Rob Robertson <rob@gangrene.berkeley.edu>, if
I interpret that table correctly. Mentioned in RFC 1700 from October 1994.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
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