🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #46749

HEADERS comand (was: Re: Xnews follow-up notification ?)

#46749
From: Curt Welch
Date: Wed, 31 May 2000 00:00
142 lines
7949 bytes
andrew@supernews.com wrote:
> In article <1eb9n93.6zm4ecsdufpcN%planb@newsreaders.com>, J. B. Moreno
> wrote:
> >Search for HEADERS and curt welch in news.software.nntp, it's not been
> >written up as a RFC, just something that has been batted around
> >(although curt has implemented it, I'm probably the only person that
> >ever uses it and I have to do so by telnet).
> >
> >headers 1- from user-agent:NewsHound?0*

BTW, did you every find that elusive version of NewsHound?

> two things just sprung to mind.
>
> a) should there be a way to use a header for selection of data but not
> have it returned in the output.

I too spent some time thinking about that.  But I concluded it wasn't
that important and would be fine to force the user to receive copies
of the header if he wanted to select on it.  Many times they will want
to see the header anyway (for example to make sure it was really what
they were looking for).

But, I support the concept of negation (!) in the wildmat, and in that
form, there are many times when it would be quite normal for the user to
want to exclude that header from the output.  For example, when filtering
out unwanted articles based on Path.

And then there's the "show me all articles which do not have an X-Meow:
header" example which looks like this:

  headers 1- x-meow:! from subject

In this example you get an extra blank field in the output which
is guaranteed never to contain data.  That just seemed wrong.  So I
thought that maybe for this special case the field should automatically be
left out of the output. But then I decided that made things too complex and
it was better to just include the field all the time even if you knew it
was going to be empty (it is only one extra byte per record returned).

But, if you wanted to give the user control over what was selected
on vs what was output, I think the simple way to do that would be to
change the semantics so that any field with a wildmat pattern would
never be included in the output.  So if you wanted to select on a field
and have it included in the output, you would be required to list it twice:

  headers 1- From:*curt* From Subject

When typing commands by hand this format would be a pain, but for computer
generated commands, it would work fine.

And that opens up the idea of supporting multiple wildmats per header to
mean OR instead of the default AND:

  headers 1- From:*curt* From:*bob* subject:*Xnews*

which would mean (From curt OR From bob) AND subject Xnews.

This would all be nice, but is it going too far???

The real question here is whether support of wildmats here is really
the right thing to do.  I'm beginning to think it isn't.  There's no
question that it's both easy to implement, and useful.  But there's
real potential for server abuse here.

For the rest of the NNTP protocol (less XPAT and some versions of NEWNEWS),
the load any one user can put on a server is directly proportional to the
amount of data they are sucking from the server.  And because pulling down
lots of data slows the client down as much as the server, the people that
write the clients are motivated to do whatever they can to minimize the
amount of data they move - which is good for both the server and the
client.

But when you allow wildmats like the above, it opens up the posibility of
the clients doing some really stupid things (in the overall sense), just
because it makes live a little easier on their end.

If the client is going to do a wildmat match on the header after it's
downloaded, and then throw it away for all headers which don't match, it
would be better if the server did that for him, so the bandwidth wasn't
wasted transfering unwanted data.

But if the client starts to force the server to scan the same overview data
multiple times, then there comes a point where this is just abuse.  The
client should have downloaded the data once, and then searched it locally
multiple times.

For example, think of a newsreader which allows you to create "pseudo
groups" by doing wildmat scans for articles in multiple groups.  For
example, a user could create a personal "XNEWS" group by combining articles
from news.sowtware.* which matched "Subject:*xnews*".  And he could create
a gravity group doing *gravity* etc.  And this would end up causing the
client to do multiple wildmat scans of the same groups.  So the server is
forced to read and processes the same overview data multiple times for the
client.

Even without the wildmat extension, the HEADERS command has the problem
of forcing the server to read and processes a lot more data than what
it has to send to the client.  But without wildmat, the client is forced
to get at least some data for every article the server has to deal with.
This keeps the ratio of server read data to transmitted data to a
reasonable level.  But once you add wildmat, then the ratio can get way out
of hand. (scan 10M articles but transmit the Message-ID of only one).

So, my current thought is that we should probably drop the wildmat support
from HEADERS.  Force the client to read the data and do any of the wildmat
types of scanning on the client side.

> b) should there be a distinction between real headers and pseudo-headers.
> Currently this distinction is blurred for XHDR, with clients expecting
> XHDR Lines and XHDR Bytes to work. I think that real headers and pseudo-
> headers should have separate namespaces, if possible.

If it's only Bytes: and Lines: we are talking about, then I don't see
this as being important enough to fix.  But if people continue to add new
pseudo-headers, then it could be a problem.  So I wouldn't mind making the
distinction.

How about creating the convention that pseudo-headers start with a :?

As in:

  Headers 1- :lines lines from subject

":lines" would be the locally calculated lines value, and "lines" would
be the real "Lines" header from the article.

For backward compatibility, "lines" and "bytes" would still have to be
supported in xhdr I assume even if :lines and :bytes worked there, but we
could fix this issue in the HEADERS command and force people to ask for
:lines and :bytes there.

Now that I think about this, I see multiple uses for special pseudo headers
that I hadn't thought about before.  For example, servers could create
special headers to return internal information that would be useful for the
local admins, like :token, or :spool-file, or :spool-file-offset, etc.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Technical Details
Message-ID: <20000531111455.642$zy_-_@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!not-for-mail
References: <8F3253F00bartctsbvnl@195.86.58.244> <8F32634E9pt101594@207.211.168.97> <8F3FD4236shivawellcom@207.126.101.100> <1eb8qlt.1s5z5uu1rag5spN%planb@newsreaders.com> <slrn8itn8b.9rk.andrew+news@uk21.supernews.com> <8F40CCF87farkle@24.64.2.57> <slrn8iubou.9rk.andrew+news@uk21.supernews.com> <8F40E796Cfarkle@24.64.2.57> <1eb9n93.6zm4ecsdufpcN%planb@newsreaders.com> <slrn8iuuto.ner.andrew+news@uk21.supernews.com>

Show Full Headers
Complete Article Headers
Message-ID: <20000531111455.642$zy_-_@newsreader.com>
Subject: HEADERS comand (was: Re: Xnews follow-up notification ?)
Date: Wed, 31 May 2000 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <8F3253F00bartctsbvnl@195.86.58.244> <8F32634E9pt101594@207.211.168.97> <8F3FD4236shivawellcom@207.126.101.100> <1eb8qlt.1s5z5uu1rag5spN%planb@newsreaders.com> <slrn8itn8b.9rk.andrew+news@uk21.supernews.com> <8F40CCF87farkle@24.64.2.57> <slrn8iubou.9rk.andrew+news@uk21.supernews.com> <8F40E796Cfarkle@24.64.2.57> <1eb9n93.6zm4ecsdufpcN%planb@newsreaders.com> <slrn8iuuto.ner.andrew+news@uk21.supernews.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!not-for-mail
X-Deja-AN: 629488316
X-User: Curt@NewsReader.Com
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
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Newsgroups: news.software.readers,news.software.nntp