🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
12 messages
12 total messages Started by Borneq Tue, 07 Jan 2020 13:25
Header lines
#88107
Author: Borneq
Date: Tue, 07 Jan 2020 13:25
2 lines
959 bytes
Which lines are generated by client and which by server?
Is limit 998 octets for whole header?
Re: Header lines
#88102
Author: Grant Taylor
Date: Tue, 07 Jan 2020 15:57
11 lines
1296 bytes
On 1/7/20 6:25 AM, Borneq wrote:
> Is limit 998 octets for whole header?

I believe that 998 octets (plus CR & LF) is for a line.  Header wrapping 
should allow the header to be longer than 998 octets.



-- 
Grant. . . .
unix || die
Re: Header lines
#88101
Author: Olivier Miakinen
Date: Tue, 07 Jan 2020 16:10
30 lines
1914 bytes
Hello,

Le 07/01/2020 à 14:25, Borneq a écrit :
> Which lines are generated by client and which by server?

The response to this question is most probably in RFC 5537: Duties of...
a Posting Agent (§3.4), an Injecting Agent (§3.5), a Relaying Agent
(§3.6), etc.

> Is limit 998 octets for whole header?

No, only for a header field *line*.

Cf. RFC 5526 §2.2:
<cit.>
         NOTE: As stated in [RFC5322], there is NO restriction on the
         number of lines into which a header field may be split, and
         hence there is NO restriction on the total length of a header
         field (in particular it may, by suitable folding, be made to
         exceed the 998-octet restriction pertaining to a single header
         field line).
</cit.>

References:
https://tools.ietf.org/html/rfc5536
https://tools.ietf.org/html/rfc5537

Regards,
-- 
Olivier Miakinen
Re: Header lines
#88103
Author: Olivier Miakinen
Date: Tue, 07 Jan 2020 16:11
11 lines
1377 bytes
Le 07/01/2020 à 16:57, Grant Taylor a écrit :
> On 1/7/20 6:25 AM, Borneq wrote:
>> Is limit 998 octets for whole header?
> 
> I believe that 998 octets (plus CR & LF) is for a line.  Header wrapping 
> should allow the header to be longer than 998 octets.

You are right.

-- 
Olivier Miakinen
Re: Header lines
#88104
Author: Olivier Miakinen
Date: Tue, 07 Jan 2020 16:12
32 lines
2100 bytes
[supersedes <qv2ai8$jir$1@cabale.usenet-fr.net> (RFC 5536 and not 5526)]

Hello,

Le 07/01/2020 à 14:25, Borneq a écrit :
> Which lines are generated by client and which by server?

The response to this question is most probably in RFC 5537: Duties of...
a Posting Agent (§3.4), an Injecting Agent (§3.5), a Relaying Agent
(§3.6), etc.

> Is limit 998 octets for whole header?

No, only for a header field *line*.

Cf. RFC 5536 §2.2:
<cit.>
         NOTE: As stated in [RFC5322], there is NO restriction on the
         number of lines into which a header field may be split, and
         hence there is NO restriction on the total length of a header
         field (in particular it may, by suitable folding, be made to
         exceed the 998-octet restriction pertaining to a single header
         field line).
</cit.>

References:
https://tools.ietf.org/html/rfc5536
https://tools.ietf.org/html/rfc5537

Regards,
-- 
Olivier Miakinen
Re: Header lines
#88105
Author: Marcel Logen
Date: Tue, 07 Jan 2020 18:38
42 lines
3233 bytes
Olivier Miakinen in news.software.nntp:

>Le 07/01/2020 à 16:57, Grant Taylor a écrit :
>> On 1/7/20 6:25 AM, Borneq wrote:

>>> Is limit 998 octets for whole header?
>> 
>> I believe that 998 octets (plus CR & LF) is for a line.  Header wrapping 
>> should allow the header to be longer than 998 octets.
>
>You are right.

An exception ist the "References" field, IMHO:

<https://tools.ietf.org/html/rfc5537#section-3.4.4>

| If the resulting References header field would, after unfolding,
| exceed 998 characters in length (including its field name but not the
| final CRLF), it MUST be trimmed (and otherwise MAY be trimmed).
| Trimming means removing any number of message identifiers from its
| content, except that the first message identifier and the last two
| MUST NOT be removed.

Thus, the References field cannot be longer than 998 octets.

<https://tools.ietf.org/html/rfc5322#section-2.2.3>:

| The process of moving from this folded multiple-line representation
| of a header field to its single line representation is called
| "unfolding".  Unfolding is accomplished by simply removing any CRLF
| that is immediately followed by WSP.  Each header field should be
| treated in its unfolded form for further syntactic and semantic
| evaluation.  An unfolded header field has no length restriction and
| therefore may be indeterminately long.
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Marcel
-- 
 ╭──────╮     ╭───╮      ╭──────╮     ╭────────╮  ╭──────────╮   ╭─╮    
 ╰─╮  ╭─╯     ╰─╮ │ ╭─╮  │      ╰──╮  ╰──╮  ╭──╯  ╰───╮      │   │ │   ╭
─╮ │  ╰──╮  ╭───╯ ╰─╯ │  ╰─╮       ╰─╮ ╭─╯  ╰───╮   ╭─╯  ╭───╯   │ ╰───╯
 ╰─╯     ╰──╯         ╰────╯         ╰─╯        ╰───╯    ╰───────╯      
Re: Header lines
#88106
Author: Borneq
Date: Tue, 07 Jan 2020 19:35
8 lines
1363 bytes
W dniu 2020-01-07 o 19:38, Marcel Logen pisze:
> | evaluation.  An unfolded header field has no length restriction and
> | therefore may be indeterminately long.
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

How detect next lines od folded fields?
- always begins with space?
- not contains ":" ?
Re: Header lines
#88108
Author: Borneq
Date: Tue, 07 Jan 2020 19:54
8 lines
1327 bytes
W dniu 2020-01-07 o 14:25, Borneq pisze:
> Which lines are generated by client and which by server?

I think about how to store articles in database (especially in Sqlite).
I prefer one table record for one article but can be better solutions?

I want store body as compressed blob, required header fields as table 
column fields, but is also variable number not required header fields.
Re: Header lines
#88109
Author: Olivier Miakinen
Date: Tue, 07 Jan 2020 20:03
19 lines
1713 bytes
Le 07/01/2020 20:35, Borneq a écrit :
> W dniu 2020-01-07 o 19:38, Marcel Logen pisze:
>> | evaluation.  An unfolded header field has no length restriction and
>> | therefore may be indeterminately long.
>>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> How detect next lines [of] folded fields?
> - always begins with space?

Yes. Space *or horizontal tab* (HTAB, ASCII value 9).

https://tools.ietf.org/html/rfc5322#section-3.2.2
https://tools.ietf.org/html/rfc5322#section-2.2

> - not contains ":" ?
No.

-- 
Olivier Miakinen
Re: Header lines
#88110
Author: Grant Taylor
Date: Tue, 07 Jan 2020 21:15
55 lines
3558 bytes
On 1/7/20 12:54 PM, Borneq wrote:
> I think about how to store articles in database (especially in Sqlite). 
> I prefer one table record for one article but can be better solutions?

Oy vey.

That question prompts opinionated responses.

I have been burned too many times by various forms of ""database 
corruption with various email / news programs to reach for them.  The 
monolithic (or few files) ever growing has implications for backups too.

I prefer to use a varient of a database that is quite common, most 
people refer to it as a file system.

I'd probably store each article as a discrete file in a directory 
(structure) for each newsgroup.  I'd likely hard link the same file into 
multiple directories when it's cross posted to multiple newsgroups.

You can easily use traditional programs for (de)compressing the files to 
save disk space.

I probably would consider some form of database for some of the 
metadata.  From, Date, Subject, References, etc. headers would be the 
most likely thing to make easier to access than extracting them out of 
each (compressed) file.

I've spent some time pontificating how to do the display and threading. 
  I've not worked out the threading yet.  But I do think that I would 
take the list of articles in the newsgroup and only load the additional 
headers of the subset of the list that are currently being displayed in 
the index of the newsgroup.  Bearing in mind that you will quite likely 
have an index view of the newsgroup with < 100 articles out of a 
newsgroup that could have tens of thousands of articles.  So why take 
time to process the additional fields of the other thousands of messages 
if it's not going to be displayed.  Modern file systems should be 
sufficiently fast enough to fetch the needed fields (from a cache) as 
you scroll.  Admittedly, I might keep the page before and after the 
current page loaded.  Possibly unread messages too as it's likely that 
the reader will jump to them.

But the threading, that is a tough nut to crack.  Most methods (that I'm 
aware of) are recursive or even more specialized.

> I want store body as compressed blob, required header fields as table 
> column fields, but is also variable number not required header fields.

Ya.  The additional header columns tend to be sparse or consume more 
space.  It's a question of what's the best way to optimize.



-- 
Grant. . . .
unix || die
Re: Header lines
#88111
Author: Russ Allbery
Date: Tue, 07 Jan 2020 21:18
13 lines
1364 bytes
Borneq <borneq@antyspam.hidden.pl> writes:

> I want store body as compressed blob, required header fields as table
> column fields, but is also variable number not required header fields.

You will also find multiple instances of the same header in an article in
some articles in the wild.

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Header lines
#88115
Author: news
Date: Fri, 10 Jan 2020 21:20
35 lines
2571 bytes
Borneq <borneq@antyspam.hidden.pl> wrote:
> 
> I think about how to store articles in database (especially in Sqlite).
> I prefer one table record for one article but can be better solutions?
> 
> I want store body as compressed blob, required header fields as table 
> column fields, but is also variable number not required header fields.
> 

My own NNTP server software (called sqlnetnews) stores each article as a
record in a SQLite database. It stores overview data for use of the OVER
command, and one column stores a blob containing both header and body
together, in the format of the protocol (with stuffed dots). If you want
to write your own, you may use compression if you wish, or you may do
other things different to what I did, too.

The SQLite website mentions that SQLite is 35% faster than file system
(approximately; depending on conditions). Large data should not be stored
in WITHOUT ROWID tables, so you should not use a WITHOUT ROWID table for
the table containing the article text. (You also cannot use WITHOUT ROWID
tables with incremental blob I/O, so that is another reason to avoid the
use of a WITHOUT ROWID table for this case.)

I might suggest to use WAL mode, which allows simultaneous reads and
writes, and is faster when there are many writes to the database.

As far as I know, the specification of NNTP does not require that article
numbers be consecutive but does require them to be monotonic in each
newsgroup, so that newer articles always have higher article numbers. My
own sqlnetnews software uses the same article numbers for all newsgroups
(but checks existence in the current newsgroup when requesting an article
by number), which I think is compatible with the NNTP specification.

-- 
Note: I am not always able to read/post messages during Monday-Friday.
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