Article View: news.software.nntp
Article #18102Re: Why does nnrpd pause on 'article' and not 'head'/'body' ?
From: Pierre Belanger
Date: Fri, 30 May 1997 00:00
Date: Fri, 30 May 1997 00:00
82 lines
2998 bytes
2998 bytes
Pierre Belanger wrote:
>
> Terry Kyriacopoulos wrote:
> >
> > I'm running INN 1.5.1 on Linux. When I telnet (loopback) to innd and
> > use the 'ARTICLE n' NNTP command, there is a one second pause before the
> > article is output, but (and this is really mysterious) there is no pause
> > at all when I use the 'HEAD n' or 'BODY n' commands.
> >
> > Can anyone confirm or explain this?
>
> The pause of 1 second is a compilation option. You can remove
> it if you want. The pause is there to avoid a 'robot' from
> polling your news server and taking too much CPU time ...
>
> I have exchanged a few messages concerning this pause with James
> and I beleive we both agreed that the pause should stay but
> instead of pausing before sending the article we modified
> nnrpd to pause _after_ sending the article. This way, robots
> still get 'paused' and others, like you and I, if you take the
> time to read the article you just retreive, you won't notice
> the pause of -1- second.
>
> I also suggested to James to have a 'variable pause' by considering
> the load average of the machine. James also suggested to have a
> pause according to how many articles the 'reader' so far took...
>
> I will post the patch here and mail it to you tomorrow when
> I get to work...
>
> Pierre Belanger - RISQ
So, here is the patch to apply to article.c:
*** article.c Fri May 30 10:35:20 1997
--- article.c Fri May 30 10:38:26 1997
***************
*** 233,249 ****
ARTcount++;
GRParticles++;
- #if defined (DONT_LIKE_PULLERS)
- {
- static int count ;
-
- count++ ;
-
- if (what == STarticle || count > 100)
- sleep (1) ; /* slow down sucking readers */
- }
- #endif
-
/*
* it should never take 5 minutes to send an article line
*/
--- 233,238 ----
***************
*** 284,290 ****
--- 273,293 ----
Printf("%s%s\r\n", *p == '.' ? "." : "", p);
}
Printf(".\r\n");
+
alarm(0); /* cancel timer */
+
+ #if defined (DONT_LIKE_PULLERS)
+ {
+ static int count ;
+
+ count++ ;
+
+ if ((what == STarticle) || (count > 100)) {
+ sleep (1) ; /* slow down sucking readers */
+ (void)fflush(stdout);
+ }
+ }
+ #endif
}
Technical Details
Message-ID:
<338EE78E.1E31@risq.qc.ca>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-mailReferences:
<5mk90t$bb$1@dita.local> <338E532C.6BC@risq.qc.ca>Show Full Headers
Complete Article Headers
Message-ID: <338EE78E.1E31@risq.qc.ca> Subject: Re: Why does nnrpd pause on 'article' and not 'head'/'body' ? Date: Fri, 30 May 1997 00:00:00 +0000 From: Pierre Belanger <pbelange@risq.qc.ca> References: <5mk90t$bb$1@dita.local> <338E532C.6BC@risq.qc.ca> 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: 244977107 Organization: RISQ (Reseau Interordinateurs Scientifique Quebecois) Newsgroups: news.software.nntp