🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
8 messages
8 total messages Started by Fluffy Thu, 03 Dec 1998 00:00
INN and sockets
#33490
Author: Fluffy
Date: Thu, 03 Dec 1998 00:00
42 lines
2596 bytes
Looking through the sample configs from pre-2.0 tarballs, it looks to
me like pretty much every platform these days is able to support the
HAVE_UNIX_DOMAIN_SOCKETS feature.  Does anyone know of any glaring
exceptions?  I'm talking about stuff in mainstream use, not historical
curiosities.

See, the reason I'm wondering is that the only way to add an entry to
history right now is to either use ctlinnd's seriously icky
one-shot-per-connection run/control socket, or to pause and seize
direct control of history; better performing if you're adding a lot of
entries like with Olaf's nifty fastcancel toy, but still kind of icky.

What I thought might be nicer is to give innd an ADDHIST command.
Like in,

     addhist <m30w$zrbj$woof@meow.meow.meow.meow.honk>
     999 Okeydokey.

This would obviously be a dangerous toy, so I'd like to keep it
disabled altogether on INET sockets, only making it available via the
relatively secure run/nntpin socket.  Then, a long-term connection
could exist and feed a stream of these ADDHIST commands right into the
daemon for straightforward processing.

Why, you didn't ask?  Well, authenticated cancel/supersedes/replaces
stuff is going to be here eventually, the processing isn't going to be
free (hell, it's slow now if you want to do old-style pretend
verification) and anything that tightens up the main select() loop
can't be all bad.  So I wanna try hanging it off the side.

And yeah, I already realize that supersedes have to be handled in
there too, but it's cheaper to notice those headers and tag an article
for some superneato cancel feed than to muck around with history and
stuff in real time.

And also-yeah, I realize this would add a couple nanoseconds of
latency to cancels, but hey, them's the breaks.

So is this as dumb an idea as it sounds?


Re: INN and sockets
#33488
Author: Fluffy
Date: Thu, 03 Dec 1998 00:00
42 lines
2712 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:

>  Fluffy> This would obviously be a dangerous toy,
> 
> No more dangerous than allowing transfer access; if someone can
> connect to innd as a peer they can abuse your server more or less as
> they please...

Well yeah, but most of that is going to be on the level of what Hippy
does, so it's going to tend to show up publicly.  Quick, quiet little
streams that just make bogus history entries aren't really going to
affect peers, so all making it available Out There accomplishes is
that the competing ISP you're peering the local froups with can make
your feed seem a little incomplete =)

It's just creepy and sinister in a not-quite-tangible way, sorta like
that cute little syslog thingy Ron tried a few months ago.

> Incidentally I implemented this myself ages ago on inn 1.7, but never
> bothered to update it when I upgraded to 1.7.2.

Oh, that's you was playing with that stuff.  I rememeber there was a
bit of conversation here about making external cancels rational, and
then it sort of went away.

> (My version returns the list of article files in the response if the
> article was already present.)

Okay, kinda like a fancy xpath.  I just want to have a way to mark
early cancels; lookups I want to move as much as possible to the
outside, again in the name of paring down that select loop.

(This is a mutant offshoot of playing with ways to make filter_innd
and innd better pals.  I'm ticked off because perl overwrites the
first few bytes of the article when I try the pointer voodoo discussed
a couple days back, so now I feel the need to exact punishment on some
other poor, innocent functions who can take it without whimpering.
And I don't like cancels very much anyway, so they're an easy target.
No, I haven't slept in 36 hours, why do you ask?)


Re: INN and sockets
#33504
Author: Andrew Gierth
Date: Thu, 03 Dec 1998 00:00
31 lines
1745 bytes
>>>>> "Fluffy" == Fluffy  <gerglery@usa.net> writes:

 Fluffy> What I thought might be nicer is to give innd an ADDHIST command.
 Fluffy> Like in,

 Fluffy>      addhist <m30w$zrbj$woof@meow.meow.meow.meow.honk>
 Fluffy>      999 Okeydokey.

 Fluffy> This would obviously be a dangerous toy,

No more dangerous than allowing transfer access; if someone can
connect to innd as a peer they can abuse your server more or less as
they please...

Incidentally I implemented this myself ages ago on inn 1.7, but never
bothered to update it when I upgraded to 1.7.2.

(My version returns the list of article files in the response if the
article was already present.)

I've also done a similar piece of code that accepts a special control
article containing a list of ids and does something similar with them.
For that, I *did* restrict where the article could come in from.

See some discussion here on the subject of NoCeM-on-spool
implementations about a year ago.

-- 
Andrew.

Re: INN and sockets
#33534
Author: Fluffy
Date: Fri, 04 Dec 1998 00:00
35 lines
2284 bytes
Silas Dunsmore <silasd@user.psyber.com> wrote:
> Jeff Garzik's "MODE FILTER" suggestion potentially solves this by making
> the "filter feed" an entire new INND mode, with its own states and allowed
> commands & responses.  

I looked at that after Russ reminded me that it was out there, but
decided pretty quickly not to intermingle this with mode filter.  In
Jeff's proposal the behavior on the ID streams is site-dependent, and
I don't want to impose hardwired behavior on it just to accommodate
what amounts to implementation-specific make-believe multithreading.

> Garzik has demo code available... not ready for production use yet.
> You should be able to get the URL from Dejanews.

Yup, reviewed it.  It does a little more than I want to do here, and
as above, I'm not crazy about hijacking a potentially cool feature for
parochial use.

> I must admit that I didn't really like the idea of write-access to the
> article buffer from the filter.  Let's not make it _easy_ to alter 
> articles, right?

Had to give it a shot, since there is a huge amount memcpying going on
in there.  Passing along size hints to avoid the operation in the
worst cases makes for an okay second-best, I guess, but it just seems,
I dunno, just ugly.

I wish there was an easy way to work read-only access in there.

-- 
"Meow!"
      --W.A. Mozart


Re: INN and sockets
#33538
Author: Silas Dunsmore
Date: Fri, 04 Dec 1998 00:00
55 lines
2957 bytes
In article <746l0n$9bj$1@meowhost.meow.invalid>,
Fluffy <gerglery@usa.net> wrote:
>Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
>
>>  Fluffy> This would obviously be a dangerous toy,
>> 
>> No more dangerous than allowing transfer access; if someone can
>> connect to innd as a peer they can abuse your server more or less as
>> they please...
>
>Well yeah, but most of that is going to be on the level of what Hippy
>does, so it's going to tend to show up publicly.  Quick, quiet little
>streams that just make bogus history entries aren't really going to
>affect peers, so all making it available Out There accomplishes is
>that the competing ISP you're peering the local froups with can make
>your feed seem a little incomplete =)


Jeff Garzik's "MODE FILTER" suggestion potentially solves this by making
the "filter feed" an entire new INND mode, with its own states and allowed
commands & responses.  

Presumably, acceptance/rejection of the "MODE FILTER" command could be
controlled seperately from, but in the same manner as, allowing NNTP
connections from your feeds.  

I.e. only hosts listed in "hosts.filter" would be allowed to issue the
"MODE FILTER" command.  Or some mechanism like that.

Garzik has demo code available... not ready for production use yet.
You should be able to get the URL from Dejanews.


>(This is a mutant offshoot of playing with ways to make filter_innd
>and innd better pals.  I'm ticked off because perl overwrites the
>first few bytes of the article when I try the pointer voodoo discussed
>a couple days back,

I must admit that I didn't really like the idea of write-access to the
article buffer from the filter.  Let's not make it _easy_ to alter 
articles, right?


-- 
Later, eh?    Silas

Narrator:      Nowadays, the Norway rat is increasingly found on jet airliners. 
               This versatile rodent will probably infest the first Space
               Cities within twenty years.  But this cute little bugger only
               has a genetic program for ubiquity.  Domesticated primates have
               also migrated all over the planet and have another genetic
               program, lacking in the rat.  Domesticated primates like you and
               me have a program to create ideas--cultures--civilizations.

Re: INN and sockets
#33549
Author: Fluffy
Date: Fri, 04 Dec 1998 00:00
25 lines
1869 bytes
Olaf Titz <olaf@bigred.inka.de> wrote:

{On Andrew's approach with sending filenames/tokens when adding a
history entry 'fails'}

> For adding an entry, you have to look it up first, because you really
> don't want duplicates there. So the above-mentioned way is actually
> _more_ efficient.

Yeah, see this is why I posted all my deluded thoughts, because you
folks would see what I was missing.  Yeah, the above *does* make lots
more sense in the case of NoCeM or public-key cancels.

The cases I was concentrating on were RFC1036 and cancel-lock
verification, where you need to poll history and try to look at the
original article first, and don't necessarily want to pre-delete the
early ones.  So for those, I'll just have to live with the cold, cruel
reality that two history lookups may be required, if I want to be
asynchronous.  Yecch.

*Urgle* Why does every single news thingy have to have some kind of
weird special case?


Perl filter article copy (Was: Re: INN and sockets)
#33561
Author: Silas Dunsmore
Date: Sat, 05 Dec 1998 00:00
58 lines
2956 bytes
In article <747prt$auu$1@meowhost.meow.invalid>,
Fluffy <gerglery@usa.net> wrote:
>Silas Dunsmore <silasd@user.psyber.com> wrote:
>
>> I must admit that I didn't really like the idea of write-access to the
>> article buffer from the filter.  Let's not make it _easy_ to alter 
>> articles, right?
>
>Had to give it a shot, since there is a huge amount memcpying going on
>in there.  Passing along size hints to avoid the operation in the
>worst cases makes for an okay second-best, I guess, but it just seems,
>I dunno, just ugly.
>
>I wish there was an easy way to work read-only access in there.

Mm-hmm.  I thought I remembered that Perl had some copy-on-write support
for its internals, but when I looked, I didn't find it.  I suspect that I
was thinking of the extra copy made when a (capturing) regexp matches.

I did find a hook that could probably be made to do it, but it looks
like more work than I'd want to do.

[from perlguts.pod]
| 
| Similarly, 'U' magic can be used much like tie() to call a C function
| any time a scalar's value is used or changed.  The C<MAGIC>'s
| C<mg_ptr> field points to a C<ufuncs> structure:
| 
|     struct ufuncs {
|         I32 (*uf_val)(IV, SV*);
|         I32 (*uf_set)(IV, SV*);
|         IV uf_index;
|     };
| 
| When the SV is read from or written to, the C<uf_val> or C<uf_set>
| function will be called with C<uf_index> as the first arg and a
| pointer to the SV as the second.

So it would seem possible to create a copy-on-write of the buffer, and
easier to just discard buffer changes entirely.

But working with "magic" variables is way over my head... I expect it'd
need a Perl-XS guru.  Any takers?

-- 
Later, eh?    Silas

Narrator:      In the 18th Century, he brought the plague to Norway, which has
               gotten blamed for him ever since.  At the Continental Congress
               in 1776, delegates complained about the number of rats in Phila-
               delphia.  By 1859, the Norway rat was known and loathed in San
               Francisco.  By 1872, he had arrived in Honolulu.  This amazing
               little beast had circumnavigated most of the globe in a few
               thousand years.

Dots have followed this migration.

Re: Perl filter article copy (Was: Re: INN and sockets)
#33573
Author: Fluffy
Date: Sun, 06 Dec 1998 00:00
21 lines
1762 bytes
Silas Dunsmore <silasd@user.psyber.com> wrote:
> I did find a hook that could probably be made to do it, but it looks
> like more work than I'd want to do.
> 
> [from perlguts.pod]

{chomp magic stuff}

> So it would seem possible to create a copy-on-write of the buffer, and
> easier to just discard buffer changes entirely.
> 
> But working with "magic" variables is way over my head... I expect it'd
> need a Perl-XS guru.  Any takers?

It's not quite all as bad as it looks, and cleaner than what I had
been playing with here (using an xsub to kick an SV into existence).
Just having it happen by referring to the variable possesses a
sufficient coolness factor to make it worth the effort.


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