Thread View: news.software.nntp
4 messages
4 total messages
Started by Julien ÉLIE
Wed, 27 Aug 2008 21:50
Max arg length of 497
Author: Julien ÉLIE
Date: Wed, 27 Aug 2008 21:50
Date: Wed, 27 Aug 2008 21:50
39 lines
2511 bytes
2511 bytes
I wondered why
Command lines MUST NOT exceed 512 octets, which includes the terminating CRLF pair.
The arguments MUST NOT exceed 497 octets. A server MAY relax these limits for
commands defined in an extension.
and found out:
http://www.academ.com/academ/nntp/ietf/2000-July/001340.html
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Overall line length is 512 (per RFC 977). Each line is terminated with CRLF,
that leaves
510. Each keyword and arguement is seperated by a space. So, a keyword followed
by a single
arguement is seperated by one space. That leaves 509.
RFC977 didn't set a max keyword length, but the longest one I could find in use
was 12
characters. So, the text says:
"Keywords MUST be at least three US-ASCII characters and MUST NOT exceed 12
US-ASCII characters."
509 - 12 = 497
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
However, the last sentence (a keyword [command?] must not exceed 12 characters)
is not in RFC 3977. Therefore extensions can define commands longer than that.
So... is there a reason why limit is still set if there is no length limit
for command names?
--
Julien ÉLIE
« Le temps, c'est des sesterces. » (Coquelus)
Re: Max arg length of 497
Author: Russ Allbery
Date: Wed, 27 Aug 2008 23:14
Date: Wed, 27 Aug 2008 23:14
17 lines
1826 bytes
1826 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> However, the last sentence (a keyword [command?] must not exceed 12
> characters) is not in RFC 3977. Therefore extensions can define
> commands longer than that. So... is there a reason why limit is still
> set if there is no length limit for command names?
Just to have set a limit so that implementations can expect it and reject
anything that doesn't fit that limit. The actual limit is to some degree
arbitrary as long as it interoperates with existing implementations, so it
doesn't matter so much how the exact number was arrived at.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Max arg length of 497
Author: Julien ÉLIE
Date: Thu, 28 Aug 2008 05:52
Date: Thu, 28 Aug 2008 05:52
46 lines
3087 bytes
3087 bytes
Hi Russ, > Just to have set a limit so that implementations can expect it and reject > anything that doesn't fit that limit. The actual limit is to some degree > arbitrary as long as it interoperates with existing implementations, so it > doesn't matter so much how the exact number was arrived at. All right, thanks. However, I see that INN currently accepts lines which ends only with LF. Moreover, lines ending with CRLF and whose length is 513 octets are accepted because of the way lines are parsed. RFC 3977 states: A CRLF pair MUST terminate all commands. Command lines MUST NOT exceed 512 octets, which includes the terminating CRLF pair. The arguments MUST NOT exceed 497 octets. and: If there is a syntax error in the arguments of a recognized command, including the case where more arguments are provided than the command specifies or the command line is longer than the server accepts, the response code 501 MUST be returned. It does not say that a news server MUST reject lines whose length exceed 512 octets, but only whose length is "longer than the server accepts"! I do not see any obligation to answer a 501 code for lines exceeding 512 octets... Unless RFC implicitly consider that such lines are not commands so they must not be considered as commands by the news server? In that is so, commands which do not end with CRLF must also be rejected... (But is it all right to do that for INN?..) -- Julien ÉLIE « -- Il est vraiment très frêle cet esquif ! -- Il vaudrait mieux ne pas prendre de risques. -- Des risques ? Une galère fortement armée contre un frêle esquif ? -- Un frêle esquif plein de Gaulois ! » (pirates)
Re: Max arg length of 497
Author: Russ Allbery
Date: Thu, 28 Aug 2008 06:18
Date: Thu, 28 Aug 2008 06:18
31 lines
2607 bytes
2607 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> It does not say that a news server MUST reject lines whose length exceed
> 512 octets, but only whose length is "longer than the server accepts"!
> I do not see any obligation to answer a 501 code for lines exceeding 512
> octets... Unless RFC implicitly consider that such lines are not
> commands so they must not be considered as commands by the news server?
Yeah, the server is not required to reject it; clients are just required
not to send it, so such lines are outside the protocol and the server can
do what it chooses with them. Most of the standard is written that way,
to allow for servers to do strange things if there's some compelling
reason.
I have no problem with INN being pretty strict about command length,
though, as there's really no justification for sending a command even
remotely close to that long.
> In that is so, commands which do not end with CRLF must also be
> rejected... (But is it all right to do that for INN?..)
It's not required to reject them; it's just required not to send them. I
think this is another one of those things that INN does to be less
annoying with debugging. (I don't remember whether telnet always does
line ending convention transformation or only on certain ports....)
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
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