🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Jeff Garzik Sun, 16 Mar 1997 00:00
hate-pullers INN bug fix patch
#15920
Author: Jeff Garzik
Date: Sun, 16 Mar 1997 00:00
53 lines
2093 bytes
This is a multi-part message in MIME format.

--------------24212F1157959D2E20B121C7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

(cc'd to inn-bugs)

I attached a simple patch to nnrpd/article.c that fixed the broken inn
1.5.1 LIKE_PULLERS behavior.  There was a [seemingly] uninitialized
variable that was incremented to 100.  On some OSs it would do nothing,
on others it had the possibility to sleep basically infinitely.

I didn't see this in 1.5.x unoff-patches, so here it is.  I thought of
an enhancement, but I didn't want to go digging through config.data
setup files.  Have an additional setting LIKE_PULLERS NICE.  Instead of
sleep(1) before an article download, which is the 'DO' behavior, have a
sleep(0) call.  On OSs that support it, sleep(0) will give up the
remainder of the process's time slice.

	Jeff

--------------24212F1157959D2E20B121C7
Content-Type: text/plain; charset=us-ascii; name="hate-pullers"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="hate-pullers"

--- article.c.orig      Sun Mar 16 09:51:31 1997
+++ article.c   Sun Mar 16 09:52:57 1997
@@ -234,14 +234,8 @@
     GRParticles++;
 
 #if defined (DONT_LIKE_PULLERS)
-    {
-      static int count ;
-
-      count++ ;
-      
-      if (what == STarticle || count > 100)
-        sleep (1) ;               /* slow down sucking readers */
-    }
+    if (what == STarticle)
+      sleep (1) ;               /* slow down sucking readers */
 #endif
 
     /*


--------------24212F1157959D2E20B121C7--


Re: hate-pullers INN bug fix patch
#15929
Author: Andrew Gierth
Date: Sun, 16 Mar 1997 00:00
32 lines
2056 bytes
>>>>> "Jeff" == Jeff Garzik <jeff.garzik@spinne.com> writes:

 Jeff> I attached a simple patch to nnrpd/article.c that fixed the broken inn
 Jeff> 1.5.1 LIKE_PULLERS behavior.  There was a [seemingly] uninitialized
 Jeff> variable that was incremented to 100.  On some OSs it would do nothing,
 Jeff> on others it had the possibility to sleep basically infinitely.

No, the variable *is* initialised - static variables initialise to 0 by
default. Your fix is no improvement.

The problem is the conditional - the original version says "delay if 
*either* we're processing an ARTICLE command, *or* we've processed more than
100 ARTICLE, HEAD or BODY commands in this session".

Since it's quite legit for a newsreader to use ARTICLE to do fetches, this
is unfairly penalising the use of ARTICLE rather than HEAD/BODY, and also
(without your change) penalises anyone reading more than 100 articles in a
session.

A better approach to fixing this is to track the time that the last command
was issued, and insert the delay if the time since the last command is less
than some limiting value. That slows down suck-feeds without impacting on
legitimate users, and also removes the temptation for a suck-feed to
disconnect and reconnect after every 99 articles.

Also, intrusive options like this should *never* default to on.

-- 
Andrew.

Re: hate-pullers INN bug fix patch
#16037
Author: Andrew Gierth
Date: Wed, 19 Mar 1997 00:00
60 lines
2801 bytes
>>>>> "Egil" == Egil Kvaleberg <egilk@sn.no> writes:

 > On 16 Mar 1997, Andrew Gierth wrote:
 >> The problem is the conditional - the original version says "delay if 
 >> *either* we're processing an ARTICLE command, *or* we've processed more
 >> than 100 ARTICLE, HEAD or BODY commands in this session".

 Egil> Are you sure of this? In that case, that code is *seriously* broken. 
 Egil> Reading using ARTICLE would be less demanding on resources then use of
 Egil> HEAD then BODY. 

I'm pretty certain, based not only on my reading of the code but also on the
reports here.

Here's the full analysis, just to prove the point:

ARTsend is called with "what" == STarticle, SThead or STbody, in response
to ARTICLE, HEAD or BODY commands respectively. (See CMDfetch.)

The LIKE_PULLERS code is this bit:

    #if defined (DONT_LIKE_PULLERS)
        {
          static int count ;

          count++ ;
        
          if (what == STarticle || count > 100)
            sleep (1) ;               /* slow down sucking readers */
        }
    #endif

So, initially, count=0 (normal static initialisation).
Count is incremented for every call to ARTsend.
The sleep(1) call is executed if the command was ARTICLE *or* if ARTsend
has been called more than 100 times.

This code has all the hallmarks of a last-minute, untested hack.

 >> That slows down suck-feeds without impacting on
 >> legitimate users,

 Egil> And why on earth would sucking feeds not be legitimate? As long
 Egil> as such feeds are used for retrieving news that would otherwise
 Egil> be retrieved directly using a newsreader, I can see nothing
 Egil> illegitimate about them whatsoever. On the contrary, sucking
 Egil> feeds of set up properly would use less resources.

Poor choice of words, perhaps. Since I operate a sucking feed myself,
I agree 100% with the above comments.

[See earlier postings of mine for the design of the code that I use
for this purpose; it uses XOVER to dedup and pre-filter, then does
all fetches on article number only (it avoids NEWNEWS).]

-- 
Andrew.

Re: hate-pullers INN bug fix patch
#16050
Author: Ragnar Lonn
Date: Wed, 19 Mar 1997 00:00
40 lines
2309 bytes
In article <87pvwv6bsb.fsf@erlenstar.demon.co.uk>, Andrew Gierth 
<andrew@erlenstar.demon.co.uk>
       <87wwr7h9hh.fsf@erlenstar.demon.co.uk> <%Vk2LzciF9@big.thought> wrote:
>
> Egil> And why on earth would sucking feeds not be legitimate? As long
> Egil> as such feeds are used for retrieving news that would otherwise
> Egil> be retrieved directly using a newsreader, I can see nothing
> Egil> illegitimate about them whatsoever. On the contrary, sucking
> Egil> feeds of set up properly would use less resources.
>
>Poor choice of words, perhaps. Since I operate a sucking feed myself,
>I agree 100% with the above comments.
>

Can't say I do, in all cases. You, as news administrator have much less
control over the resources a sucking feed demands of your server. It's
all up to the peer. If you have one machine dedicated for reading and
another dedicated for feeding, you'd want all the slow readers to use
the reader machine and all the feeders to feed to/from the feed machine.
If people start setting up sucking feeds to your reader machine,
performance may degrade for the slow (e.g dialup) readers.

Anyone can decide to setup a sucking feed from your server but to
get a real NNTP feed they'd have to ask you. I think it makes a difference.

Also, it'd surprise me a lot if an NNTP feed wasn't a hell of a lot more
efficient CPU- and I/O wise than a sucking feed. For the server, that is,
not for the sucking client.

  /Ragnar, Algonet



>[See earlier postings of mine for the design of the code that I use
>for this purpose; it uses XOVER to dedup and pre-filter, then does
>all fetches on article number only (it avoids NEWNEWS).]
>

Re: hate-pullers INN bug fix patch
#16051
Author: Egil Kvaleberg
Date: Wed, 19 Mar 1997 00:00
31 lines
1728 bytes
On 16 Mar 1997, Andrew Gierth wrote:

> The problem is the conditional - the original version says "delay if 
> *either* we're processing an ARTICLE command, *or* we've processed more than
> 100 ARTICLE, HEAD or BODY commands in this session".

Are you sure of this? In that case, that code is *seriously* broken. 
Reading using ARTICLE would be less demanding on resources then use of
HEAD then BODY. 

> That slows down suck-feeds without impacting on
> legitimate users,

And why on earth would sucking feeds not be legitimate? As long as such
feeds are used for retrieving news that would otherwise be retrieved
directly using a newsreader, I can see nothing illegitimate about them
whatsoever. On the contrary, sucking feeds of set up properly would use
less resources. 

For what it is worth, all ISPs that I know about have nothing against
sucking news, with an exception re. use of the NEWNEWS command, of course. 

Egil
-- 
Email: egilk@sn.no  Voice: +47 22523641, 92022780 Fax: +47 22525899
Snail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
URL:   http://home.sn.no/home/egilk/	    PGP: finger:egilk@sn.no


Re: hate-pullers INN bug fix patch
#16106
Author: Catherine Anne Foulston
Date: Thu, 20 Mar 1997 00:00
29 lines
1805 bytes
In article <%Vk2LzciF9@big.thought>, Egil Kvaleberg  <egilk@sn.no> wrote:
>On 16 Mar 1997, Andrew Gierth wrote:

>And why on earth would sucking feeds not be legitimate? As long as such
>feeds are used for retrieving news that would otherwise be retrieved
>directly using a newsreader, I can see nothing illegitimate about them

If that's all someone's doing, I don't care.  The trouble is if
they are using a suck feed to try to get a real feed -- i.e.
transferring substantially more than they would ever read with
a newsreader, which generally means they are providing it to
other people.  If I wanted them to have a feed, I would give them
one.  If those other people are not able to read news from my
server, there's a reason for that.

>whatsoever. On the contrary, sucking feeds of set up properly would use
>less resources. 

Less than what?  Possibly less than regular newsreading.  But a
suck feed uses more resources than a regular outgoing NNTP feed.

--
Catherine Foulston      cathyf@rice.edu      Rice University Network Management

"Do not disrupt my carefully controlled pattern of hype or
YOU WILL BE PUT IN A BOX WITH BILL GATES AND SHAKEN."  -- Kibo

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