Here is a summary of MAXARTNUM implemented in Spitfire News Server.^^^^^^^^^^^^^
- If MAXARTNUM disabled for "anonymous" accessgroup, server will reply
with "480 authentification required".
- If MAXARTNUM disabled for another accessgroup, server reply with
"502 MAXARTNUM command disabled by administrator".
- MAXARTNUM accept a number as argument or ^31 -> ^63. If MAXARTNUM <
^31 or > ^63, server reply with "501 syntax error".
- When MAXARTNUM is not used and a newsgroup contains articles > ^31,
pointers are adjusted to fit ^31 :
- High = ^31
- Count = Estimated articles (High-Low)+1
- If a reader use NEXT to access numbers > ^31, server reply with "401
maximum article number reached".
- Articles > ^31 can be retrieved with their <Message-ID>. In this
case, article number is set to "0" and ALL newsgroups in Xref header
with a value > 2^31 are "on-the-fly" set to 0. Size of article is
also adjusted "on-the-fly".
- NEWNEWS display ALL <Message-ID> (< or > ^31).
- Once used, MAXARTNUM cannot be set again.
Please let me know if you find something wrong or if you have any suggestions.
- MAXARTNUM accept a number as argument or ^31 -> ^63. If MAXARTNUM <It’s not clear what this means.
If your notation ^31 really means 2^31 then your description is off by
one from RFC3977, where the maximum is 2^31-1, and article numbers >=
2^31-1 are forbidden.
MAXARTNUM,pointers are adjusted to fit MAXARTNUM :
- MAXARTNUM accept a number as argument or ^31 -> ^63. If MAXARTNUM <It’s not clear what this means.
C: HELP
...
S: MAXARTNUM number|^31-63
...
I hope this ABNF is correct, but perhalps it's not.
MAXARTNUM accept an article number or values from ^31 to ^63.
So does your notation ^N mean 2^N-1 then?Yes.
C: MAXARTNUM ^31
S: 202 2147483647 => 2^31-1?
C: MAXARTNUM ^40
S: 202 1099511627775 => 2^40-1?
MAXARTNUM ^63
202 9223372036854775807 => 2^63-1?
I think your command should just use numbers, rather than your own
private notation.
"I could also live with a notation like "^31" being allowed, in both directions, as a synonym for 2 to that power minus 1; that is:
I think your command should just use numbers, rather than your own
private notation.
BIGNUM ^40
is equivalent (if my calculator isn't lying) to:
BIGNUM 1099511627775
I doubt the ^ syntax is useful, everyone should have a bash around
So I don't see any problem with this.
Nor do I see a problem, it's just not really needed as long as you know
what you put in the field.
It usually helps, when you define standards and protocols, to not have
too many ways to do things, especially on APIs.
Or at least this is my opinion after implementing a filtering proxy on
top of INN and having to handle all the different ways you can select an article :)
- If MAXARTNUM disabled for "anonymous" accessgroup, server will reply
with "480 authentification required".
- If MAXARTNUM disabled for another accessgroup, server reply with "502 MAXARTNUM command disabled by administrator".
- MAXARTNUM accept a number as argument or ^31 -> ^63. If MAXARTNUM <
^31 or > ^63, server reply with "501 syntax error".
- If a reader use NEXT to access numbers > ^31, server reply with "401 maximum article number reached".So, before using MAXARTNUM, it should be:
- Once used, MAXARTNUM cannot be set again.
- Articles > ^31 can be retrieved with their <Message-ID>. In this case, article number is set to "0" and ALL newsgroups in Xref header with a
value > 2^31 are "on-the-fly" set to 0. Size of article is also adjusted "on-the-fly".
- NEWNEWS display ALL <Message-ID> (< or > ^31).
Please let me know if you find something wrong or if you have any suggestions.
I'll use the ^n notation below, meaning 2^n-1.
We'll have to discuss whether we should keep it (client<->server or only client->server) or only use numbers.
So maybe ^n should not be standardized, but of course could remain
"private" for use by the developers of the implementation.
First scenario
--------------
The news server handles up to 2^64-1 articles but, at startup, is
configured to show only up to 2^31-1 to clients for interoperability
reasons.
It then advertises in CAPABILITIES:
MAXARTNUM ^31
If a news client sends MAXARTNUM ^63, it will then answer 202 with that
new mutual maximum and advertise in CAPABILITIES:
MAXARTNUM ^63
Had the client sent MAXARTNUM ^64 or MAXARTNUM ^128 or MAXARTNUM without
any argument (saying it can handle arbitrary numbers), the new mutual
maximum advertised would have been:
MAXARTNUM ^64
As far as I am concerned, I prefer the first scenario because it makes
it clear what the maximum article number in effect is.
If the news client is OK with that, it does not have to send MAXARTNUM. Otherwise, in the second scenario, it does not know what is the current mutual maximum so it needs sending it in order not to be blocked to 2^31-1. An implementation could even prefer to have MAXARTNUM set to ^64 at
startup and not ^31 (the initial number should not be mandatory - just a recommendation that in 2022, ^31 is still a good choice for interoperability).
Allez les Bleus !! :-)
Incidentally, is there a reason for Spitfire not to handle numbers up to 2^64-1, using unsigned long long?
I would not return 501 if MAXARTNUM > your maximum.
MAXARTNUM ^100
202 (2^63-1) <-- the mutual maximum negotiated
I would only return 501 if there is more than 2 arguments or, when an argument is given, this argument is below 2^31-1 or is not a number or
is not "^" followed with a number.
401 MAXARTNUM
And after using it, I propose:
502 Next article has an article number larger than our mutual maximum
- Articles > ^31 can be retrieved with their <Message-ID>. In this
case, article number is set to "0" and ALL newsgroups in Xref header
with a value > 2^31 are "on-the-fly" set to 0. Size of article is also
adjusted "on-the-fly".
Is it really necessary to change the numbers in Xref header fields?
So I would just keep Xref untouched when sending it in overview data or
in header fields.
- NEWNEWS display ALL <Message-ID> (< or > ^31).Yes!
It could be worth mentioning the case of an empty newsgroup with large numbers. The preferred notation is:
Low = MAXARTNUM
High = MAXARTNUM-1
Count = 0
Also, a second call to MAXARTNUM causes 502 (already used).
MAXARTNUM INT32Â Â Â Â Â Â Â => ^31
An implementation could even prefer to have MAXARTNUM set to ^64 at
startup and not ^31 (the initial number should not be mandatory - just a recommendation that in 2022, ^31 is still a good choice for interoperability).
I would only return 501 if there is more than 2 arguments or, when an
argument is given, this argument is below 2^31-1 or is not a number or
is not "^" followed with a number.
Hum, is there a reason to do :
C: MAXARTNUM ^100
S: 202 (2^63-1) <-- the mutual maximum negotiated
and not :
C: MAXARTNUM ^1
S: 202 (2^31-1) <-- the mutual minimum negociated
Again, I don't see the point to set a value other than the maximum value
of an int type
- Articles > ^31 can be retrieved with their <Message-ID>. In this
case, article number is set to "0" and ALL newsgroups in Xref header
with a value > 2^31 are "on-the-fly" set to 0. Size of article is
also adjusted "on-the-fly".
Is it really necessary to change the numbers in Xref header fields?
It is not "necessary" but, I mean, if artcile number is set to "0", why
not to do the same in Xref?
I know it's a bit of coding but, why not?
So I would just keep Xref untouched when sending it in overview data
or in header fields.
For overview data (OVER/HDR), Xref is not concerned because you can't go outside the [range] (first-MAXARTNUM), so Xref is untouched.
Since this number is (usually) based on the integer type used by the developer, I really don't see the point of accepting anything other than
the maximum values of the main integer types.
So I'll go for a single, simple syntax, in both directions, like :
MAXARTNUM INT32Â Â Â Â Â Â Â => ^31
MAXARTNUM UINT32Â Â Â => ^32
MAXARTNUM INT64Â Â Â Â Â Â Â => ^63
MAXARTNUM UINT64Â Â Â => ^64
MAXARTNUMÂ Â Â Â Â Â Â => Unlimited.
Away goofy numbers, away very confusing ^N (meaning ^N-1 !).
What is the real benefit of a MAXARTNUM 1234567890?
What is the real benefit of a MAXARTNUM ^35?
[...]
I explain: how could you be sure that all implementations are limited to
the proposed types?
32-bit Perl for instance can go up to signed 2^53-1 integers on systems
with double-precision floats (after that number, the integer precision
is lost).
And I bet there are other languages with different possible limits.
[...] any other type (based on powers of 3 or anything else), it will be difficult to have implementations be updated to understand these new types. On the contrary, numbers will always be numbers :-)
What is the real benefit of a MAXARTNUM 1234567890?
What is the real benefit of a MAXARTNUM ^35?
I'll use the ^n notation below, meaning 2^n-1.
We'll have to discuss whether we should keep it (client<->server or only client->server) or only use numbers.
Since this number is (usually) based on the integer type used by the developer, I really don't see the point of accepting anything other than
the maximum values of the main integer types.
So I'll go for a single, simple syntax, in both directions, like :
MAXARTNUM INT32 => ^31
MAXARTNUM UINT32 => ^32
MAXARTNUM INT64 => ^63
MAXARTNUM UINT64 => ^64
MAXARTNUM => Unlimited.
Away goofy numbers, away very confusing ^N (meaning ^N-1 !).
What is the real benefit of a MAXARTNUM 1234567890?
An implementation could even prefer to have MAXARTNUM set to ^64 at
startup and not ^31 (the initial number should not be mandatory - just
a recommendation that in 2022, ^31 is still a good choice for
interoperability).
Because Russ still have trn users (:-)), I think we MUST keep the
"legacy" NNTP int type as default value.
So I will go for :
Startup : INT32 is initial and "legacy" MAXARTNUM value (2^31-1),
otherwise some clients will LIST and receive newsgroups with large
numbers (No pointers adjustments).
C: CAPABILITIES
S: MAXARTNUM UINT64 (The highest number the server support)
Then :
C: MAXARTNUM UINT64 (Or less)
S: 202 UINT64 (Or less)
C: CAPABILITIES
S: *** MAXARTNUM is NOT in the list (Meaning "already set") ***
C: MAXARTNUM INT32
S: 502 mutual maximum article number already negotiated and set to UINT64.
Any thoughts?
I would prefer plain numbers.
Possibly in hexadecimal (if this helps debugging):
MAXARTNUM 7FFFFFFFFFFFFFFF
The main point is that 2^31-1 MUST be the default value with NNTP...
C: CAPABILITIES > S: MAXARTNUM 2147483647 18446744073709551615>> for 2^31-1 and 2^64-1...
C: CAPABILITIES
S: MAXARTNUM 2147483647 0
The only point I see in not sending a syntax error (501) to MAXARTNUM
with an article number below 2^31-1 is that there was no negotiation.
The client says it can handle article numbers up to 1, and the server
answers OK let's go up to 2^31-1. That seems weird.
Look for instance at how TLS clients and servers negotiate the cipher or protocol version to use. If a client wants TLS 1.0 and the server only offers 1.2 and above, it won't answer OK let's do 1.2.
Or if a client sends "LIST ACTIVE news.*" and the server answers OK I'll
send you the active list of news.* and also of comp.* :-)
  Firstly, let us learn from the past and *not* call this - or make
  it - a "64 bit" facility.
OVER and HDR both accept either an article number (or a range) or a Message-ID. If Spitfire does not implement OVER <mid> then there's
indeed nothing to do for that command. Otherwise, you MAY do something.
However, I still have a concern about what you call "goofy numbers". > What would be their definition? :-)numbers, but 2^53-1 and 2^128-1 may are. As well as > other kinds of
What is the real benefit of a MAXARTNUM 1234567890? >> What is the real benefit of a MAXARTNUM ^35?> > Probably not these
Le 11/12/2022 12:08, Michael Bäuerle a écrit :
I would prefer plain numbers.
Yes.
Possibly in hexadecimal (if this helps debugging):
MAXARTNUM 7FFFFFFFFFFFFFFF
Since all numbers are always in decimal (commands ARTICLE, HEAD or BODY, responses to GROUP, LAST or NEXT, etc.), I suppose it would more help debugging if this number is in decimal too rather than in hexadecimal.
So does your notation ^N mean 2^N-1 then?Yes.
C: MAXARTNUM ^31
S: 202 2147483647 => 2^31-1?
C: MAXARTNUM ^40
S: 202 1099511627775 => 2^40-1?
MAXARTNUM ^63
202 9223372036854775807 => 2^63-1?
I think your command should just use numbers, rather than your own
private notation.
As far as I know, for two decades there is nothing "official" about
large numbers, so how this notation can be "private"?
If readers wants to use MAXARTNUM with a number, it's accepted.
If readers wants to use a shorten way to set a number, it's accepted.
C: MAXARTNUM ^1The only point I see in not sending a syntax error (501) to MAXARTNUM
S: 202 (2^31-1) <-- the mutual minimum negociated >>
with an article number below 2^31-1 is that there was no negotiation.
The client says it can handle article numbers up to 1, and the server
answers OK let's go up to 2^31-1. That seems weird.
I may have misunderstood the purpose of this extension which, if I am
not mistaken, is mainly intended to go beyond the current limitation of 2^31-1.
So it will now allow us to go below the current limitation that we are
trying to overcome? Really?
What about the number of articles shown in LIST COUNTS?
Sorry to ask but now, does it seems always weird to reply
C: I want 1
S: Syntax error or
Or
S: You can't go below 2^31-1, so it's 2^31-1
?
So what we do?
We accept 1 or with set a minimal and maximal values?
It is an error (501), not a success (206):
My suggestion is to return 501 if there is more than 2 arguments or,
when an argument is given, this argument is strictly below 2^31-1 or is
not a number.
What about the number of articles shown in LIST COUNTS?
Same thing as the estimated article count returned in GROUP commands. It
is limited to the negotiated maximum value. No low water mark, high
water mark or estimated article could should exceed it.
Ok :)It is an error (501), not a success (206):
Estimate number is always real number of articles if all articles
numbers are < MAXARTNUM.
If not, it's (MAXARTNUM-First)+1, except if the result is > real count number.
C: STAT <DwE867tDRCo@dev.spitfire-nntp.fr>
S: 223 0 <DwE867tDRCo@dev.spitfire-nntp.fr> article exist.
Article number set to "0", all newsgroup > MAXARTNUM are set to 0
C: OVER 1-
S: 224 overview information follows:
S: 2147483646Â Â Â Inside ^31Â Â Â Franck <my@mail.is.invalid>Â Â Â Fri, 9 Dec
2022 06:08:46 +0100Â Â Â <DQoDAeVAbws@dev.spitfire-nntp.fr>Â Â Â 1084 1Â Â Â Xref: dev.spitfire-nntp.fr local.test.maxartnum:2147483646
S: 2147483647Â Â Â Re: Inside ^31Â Â Â Franck <my@mail.is.invalid>Â Â Â Fri, 9
Dec 2022 06:09:30 +0100Â Â Â <DpJxkOqyBtc@dev.spitfire-nntp.fr> <DQoDAeVAbws@dev.spitfire-nntp.fr>Â Â Â 12504
S:.
C: NEXT
S: 223 2147483647 <DpJxkOqyBtc@dev.spitfire-nntp.fr> article selected.
C: NEXT
S: 401 MAXARTNUM
C: NEXT
S: 502 next article has a number higher than our mutual maximum.
C: MAXARTNUM
S: 202 18446744073709551616 is our mutual maximum article number.
Your formula is OK.
the maximum (MAXARTNUM-First+1) it could be a ratio of it as you have
the real count on the whole group:
ceil((MAXARTNUM-First+1)*(Real count)/(High-First+1))
In your example, it would give 1 article because standard deviation is
high (3 articles near 2^31 and 1 near 2^32) but I believe it would work better in real life.
C: STAT <DwE867tDRCo@dev.spitfire-nntp.fr>exists
S: 223 0 <DwE867tDRCo@dev.spitfire-nntp.fr> article exist.
Article number set to "0", all newsgroup > MAXARTNUM are set to 0OK that's fine.
I bet it's a copy/paste error (otherwise overview data for the second
article is not complete).
It would then propose "MAXARTNUM 0" to indicate that.
And naturally, the argument 0 would not be a syntax error (contrary to
other numbers < 2^31-1). And not giving an argument would then be a
syntax error (501 response code).
the maximum (MAXARTNUM-First+1) it could be a ratio of it as you have
the real count on the whole group:
ceil((MAXARTNUM-First+1)*(Real count)/(High-First+1))
Call it F2
[...] > So, it seems F2 is a better choice except in the case F2 < F1.
I added this condition.
Article number set to "0", all newsgroup > MAXARTNUM are set to 0OK that's fine.
As the exact form of an <article-locator> is implementation-specific,
does it make more sense to set this value to MAXARTNUM?
Xref: dev.spitfire-nntp.fr local.test.maxartnum:MAXARTNUM
And naturally, the argument 0 would not be a syntax error (contrary to
other numbers < 2^31-1). And not giving an argument would then be a
syntax error (501 response code).
Done but to be sure :
C: MAXARTNUM 0
S: 202 18446744073709551616 is our mutual maximum article number. <= The maximum the server can handle.
Xref: dev.spitfire-nntp.fr local.test.maxartnum:MAXARTNUMThat's why I would tend to prefer 0.
If anyone has another point of view about it, please tell us!
Meanwhile, here is what I have came up with as for that header field.
I believe it is the most problematic point to discuss in the whole
MAXARTNUM specification. Should we really enforce something about Xref,
and what exactly?
Handling the Xref Header Field
------------------------------
** Do we really need to have that requirement?
Suppose an article is crossposted in group1, with article number 1, and group2, with article number 2^40... A large number will be present in
the Xref header field. It then means that the news server always has to check the contents of the Xref header field and do an appropriate change
if needed. It seems overkill and time-consuming!
I am unsure we want to add that bargain to all compliant implementations.
Is it sure some news clients may break on invalid Xref header fields? (I
am under the impression that client implementations are robust to the
variety of invalid headers there are in the wide, but I may be wrong...)
At least, I've checked trn source code (bits.c). It parses the number
after ":" in Xref with atol(), so it will get at most INT_MAX and
normally won't crash. (It should of course be tested; that's just an assumption.)
We can imagine that implementations don't do any checks when they know
they do not carry any newsgroup with large article numbers, and begin
doing such checks and alterations otherwise.
C: MAXARTNUM 0Yes.
S: 202 18446744073709551616 is our mutual maximum article number. <=
The maximum the server can handle.
Xref: dev.spitfire-nntp.fr local.test.maxartnum:MAXARTNUMThat's why I would tend to prefer 0.
Fine for me.
Handling the Xref Header Field
In any case, I understood everything without rereading :)
** Do we really need to have that requirement?
If we limit numbers for the rest, I see no good reason to not do the
same with xref header.
Is it sure some news clients may break on invalid Xref header fields?
(I am under the impression that client implementations are robust to
the variety of invalid headers there are in the wide, but I may be
wrong...)
To remove the doubt that you may be wrong, why not to set it to "0"? :)
We can imagine that implementations don't do any checks when they know
they do not carry any newsgroup with large article numbers, and begin
doing such checks and alterations otherwise.
This is how SNS already works.
There is no check when no newsgroup carry large numbers and some checks (number/last/count/xref) only on newsgroups that carry large numbers.
C: MAXARTNUM 0Yes.
S: 202 18446744073709551616 is our mutual maximum article number. <=
The maximum the server can handle.
Ok, to date, MAXARTNUM is finished for me.
Ok, to date, MAXARTNUM is finished for me.
It is what you thought ^^
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 78:30:13 |
Calls: | 6,716 |
Files: | 12,247 |
Messages: | 5,357,830 |