🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #61331

Re: Custom Client Software - Last Quick Question

#61331
From: Curt Welch
Date: Sat, 12 Oct 2002 02:40
115 lines
6964 bytes
t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t (DS) wrote:
> there are 3 basic operations, strictly related to NNTP TRANSFER (no
> posting)
>
> 1- Download grouplists
> 2- Download Headers
> 3- Download articles & decode files

There is posting of course. But maybe you don't intend to suport that with
your tool.  But yes, you have the basic idea above.  Once you connect and
get authenticated, then all you need for the basics is LIST ACTIVE, GROUP,
XOVER, ARTICLE.  You can make a fine newsreader using only those.  But as
you you add more advanced fatures to your newsreader, and try to do fancer
things, you can end up using just about all the NNTP commands.

> i am now on step 2. i have a lot of experience with database programming,
> and IMO, NNTP readers are more of a database application than anything
> else.

An NNTP server is nothing but a custom designed article database.  The
newsreader is just a database browsing tool.  How much of the database
you choose to download and cache on your local system is a function of
what you are trying to do with your application.  The more you download
and cache, the more complex it gets.

> download group names into a database - then subscribe/unsubscribe
> download headers into a database - then combine multipart's (probably the
> most tricky as far as the database procedure's are concerned.
> download article parts to disk, combine, decode.
>
> i know i'm over simplifying this, but these (IMO) are the main functions.

Yeah, the basics aren't to tough.  The deatals can keep you busy for the
rest of you life however (partly because they change constantly).

> i am developing this as a multi-user database application, which in it's
> own right isn't the easiest thing to do.

An NNTP server is a multiuser application.  Most people choose to let the
multiuser part stay on the server side.  If you need multiuser power
locally, then most people will chose to implement a real NNTP server
localy, instead someting else.  But there are lots of ways to do it, each
with their own sets of advanatages and disadvanates.

> so to say i don't know what i'm doing (not that you said that, i know it
> was a general statement) is only partially correct because of my
> unfamiliarity with the NNTP protocol.

I have no idea what I'm doing is at least some part of all the code I
write.  The goal is to know what you are doing when you are done, not when
you start. :)

> i am developing in a 'component' fashion, that is, call a single function
> to d/l headers, or groups, or whatever and writing marshalling procedures
> to keep everything in check between threads. and when i'm donw, tour
> right, i'll probably have to re-code a bunch of it.

I personaly write all my code by starting with something small and evolving
it into to final work.  I've never tried to track it, but I'm sure I throw
away as much as I write for everything I do.  I do that for news postings
as well.  Sometimes I spend an hour writting a message and then just decide
it's not worth posting and throw it all way.

> PS- (again, i know it was a general statement) i'm using the same
> procedure to check for (part/totalParts) no matter where it is in the
> subject line.

:)

> so the big questions here is.....
>
> should i find what appears to be a (part/totalParts reference) in the
> subject line, how far towards the beginning of the subject line would you
> think it should be interpereted as such. even if it's the first thing in
> the subject?

Anywhere in the line.  Even if it's the first thing.  At least that is how
I would code it.  I think. (I'd have to check to be sure).

The general algorithm requires you to sort the entire list first, and then
try to match up subjects.  When sorted (correctly), the subjects should be
in order for you, so the job becomes one of trying to figure out if the
current article.

Sorting 100,000 headers however is slow, so that's big issue number 1.
Newsreaders not geared for downloading multpart posts solve the problem
many times by simply not downloading that many headers at once.  And some
simply crash if you actually try to do it.  But a download tool must deal
with huge group lists these days, and must deal with them quickly.  So you
have to do some fairly advanced stuff like hashing the headers as a way to
quickly group them together as you download.  And to save memory, you only
save one copy of of each subject instead of saving 50 or 100 copies
(dealing with the fact that all the subjects are in fact different).

Then there is all the problems you have to deal with.  Like multiple
articles with the exact same subject but one is the multipart post you are
looking for and the others are text followup messages.  Or some happen from
the first attempt a guy made to post a file, but when his modem
disconnected, he started again, but used the same subjects the second time.
Etc.

There's no end to the crap you find in newsgroups that will confuse your
code if you don't add special cases to deal with it.

And the same stuff happens with news servers as well - like articles which
don't show up in the XOVER data in the high-low range from the group
command but yet, when checked again an hour later, are there.  Or articles
which are listed but in fact are not available for download.  And having to
deal with issues like a newsgroup which gets renumbed.  There's no end to
the fun to be had when writing usenet software. :)

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20021011224034.803$eh@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!199.45.45.8!cyclone1.gnilink.net!ps01-chi1!rip!news.webusenet.com!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <92A385EF1idispcom@64.8.1.226> <20021010142425.883$Mr@newsreader.com> <4005l.aa2202@archiver.winews.net> <92A4A430Didispcom@64.8.1.226> <20021011164437.597$MG@newsreader.com> <92A4CE566idispcom@64.8.1.226>

Show Full Headers
Complete Article Headers
Message-ID: <20021011224034.803$eh@newsreader.com>
Subject: Re: Custom Client Software - Last Quick Question
Date: Sat, 12 Oct 2002 02:40:34 +0000
From: curt@kcwc.com (Curt Welch)
References: <92A385EF1idispcom@64.8.1.226> <20021010142425.883$Mr@newsreader.com> <4005l.aa2202@archiver.winews.net> <92A4A430Didispcom@64.8.1.226> <20021011164437.597$MG@newsreader.com> <92A4CE566idispcom@64.8.1.226>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!199.45.45.8!cyclone1.gnilink.net!ps01-chi1!rip!news.webusenet.com!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com lmJmOJK3@M6.i0bypw4GS@@0itj_JBd@4VV@5g_mLGOXK.Us
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 114