[net.news] Extension to L

ken@turtlevax.UUCP (Ken Turkowski) (04/03/85)

Some time ago, someone posted an enhancement to news to allow an
extension of the "L" flag in the sys file to say that articles
from "close" neighbors, as well as articles generated locally,
should be passed on to the other neighbors.  For example,
	nsc:net,fa,usa,na,ca,ba,mod,to.nsc:BFL2:/usr/spool/batch/nsc
should send on articles that have been generated locally, as well
as those generated within 2 hops.  I put in this change, but it seems
as though the number doesn't make a difference.  ALL of our neighbors
get our articles and those of our one-hop neighbors, REGARDLESS of
whether their sys line has L0, L1, or L2.

Has anyone else experienced similar problems?  Any fixes or alternate
ways to get the same effect?
-- 

Ken Turkowski @ CADLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,nsc,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken@DECWRL.ARPA

bytebug@pertec.UUCP (roger long) (05/01/85)

> Some time ago, someone posted an enhancement to news to allow an
> extension of the "L" flag in the sys file to say that articles
> from "close" neighbors, as well as articles generated locally,
> should be passed on to the other neighbors.  For example,
> 	nsc:net,fa,usa,na,ca,ba,mod,to.nsc:BFL2:/usr/spool/batch/nsc
> should send on articles that have been generated locally, as well
> as those generated within 2 hops.  I put in this change, but it seems
> as though the number doesn't make a difference.  ALL of our neighbors
> get our articles and those of our one-hop neighbors, REGARDLESS of
> whether their sys line has L0, L1, or L2.
> 
> Has anyone else experienced similar problems?  Any fixes or alternate
> ways to get the same effect?
> -- 
> Ken Turkowski @ CADLINC, Menlo Park, CA

As I was the "someone", I worked with Ken for a bit and did discover
a small problem in the change.  If you add the following indicated
lines to the previous patch, you'll find that if you just specify "L"
in the sys file, inews will act as it did before, only forwarding
locally generated articles.

----------
	if (local) {		/* allow local to mean within 'n' hops */
		++ptr;
		if (isdigit(*ptr))
			local = *ptr - '0';
       +	else
       +		local = 0;
		for (ptr = h.path; *ptr != '\0'; local--)
			while (*ptr++ != '\0')
				;
		if (local < 0) {
			fclose(ifp);
			return FALSE;
		}
	}
----------
-- 
	roger long
	pertec computer corp
	{ucbvax!unisoft | scgvaxd | trwrb | felix}!pertec!bytebug

ken@turtlevax.UUCP (Ken Turkowski) (05/02/85)

I have indeed tested Roger Long's extension to the L flag, and found it
to work well.  It is reasonably short; maybe Roger could repost a patch
file to ifuncs.c.  It will help the robustness of the net, and is
something that ought to be in news 2.10.3.
-- 

Ken Turkowski @ CADLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,nsc,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken@DECWRL.ARPA

bytebug@pertec.UUCP (roger long) (05/19/85)

As has been previously discussed, the patch I originally posted had
a minor flaw, and it was suggested that I repost the entire patch 
for those people who had ignored it the first time.

What I've done is extend the meaning of the "L" flag in the sys
file.  Where before you could put an "L" to only forward news items
generated on the local system, you may now specify "Ln" to forward
news items generated within "n" hops of your machine.  Thus, "L1"
would forward news items generated on your machine, and all machines
that your machine talks to.  "L2" would forward news items generated
on your machine, all the machines your machine talks to, and all the
machines that these machines talk to.  The idea I had was go gather
news from one local area and be able to send it to a remote area
quickly, rather than have it trickle through the entire system as it
does now.  

The patch has been working on my machine for quite some time.  I've
been forwarding and receiving "L3" worth of articles to "pesnta", a
Northern California site for the past several months.  It results in
my getting the California local newsgroup articles from Northern 
California sooner than if I waited for them to trickle down the chain.
I, in turn, post these article to the rest of the machines I talk to,
thus starting the propagation of the articles here in the lower half
of the state.

The patch to do this follows in "diff -c" format:

*** ifuncs.c.bak	Thu Dec 27 20:27:45 1984
--- ifuncs.c	Sun May 19 06:50:25 1985
***************
*** 3,9
   */
  
  #ifndef lint
! static char	*SccsId = "@(#)ifuncs.c	2.35	9/12/84";
  #endif !lint
  
  #include "iparams.h"

--- 3,9 -----
   */
  
  #ifndef lint
! static char	*SccsId = "@(#)ifuncs.c	2.35.1	12/27/84";
  #endif !lint
  
  #include "iparams.h"
***************
*** 84,89
  
  /*
   * Transmit file to system.
   */
  #define PROC 0004
  transmit(sp, ifp, maynotify)

--- 84,91 -----
  
  /*
   * Transmit file to system.
+  * 27 Dec 84:	pertec!bytebug changed "local" to mean article originated
+  *		within 'n' hops of host.
   */
  #define PROC 0004
  transmit(sp, ifp, maynotify)
***************
*** 105,111
  /* F:	append name to file */
  	int appfile = (index(sp->s_flags, 'F') != NULL);
  /* L:	local: don't send the article unless it was generated locally */
! 	int local = (index(sp->s_flags, 'L') != NULL);
  /* N:	notify: don't send the article, just tell him we have it */
  	int notify = maynotify && (index(sp->s_flags, 'N') != NULL);
  /* S:	noshell: don't fork a shell to execute the xmit command */

--- 107,113 -----
  /* F:	append name to file */
  	int appfile = (index(sp->s_flags, 'F') != NULL);
  /* L:	local: don't send the article unless it was generated locally */
! 	int local = ((ptr = index(sp->s_flags, 'L')) != NULL);
  /* N:	notify: don't send the article, just tell him we have it */
  	int notify = maynotify && (index(sp->s_flags, 'N') != NULL);
  /* S:	noshell: don't fork a shell to execute the xmit command */
***************
*** 113,121
  /* U:	useexist: use the -c option to uux to use the existing copy */
  	int useexist = (index(sp->s_flags, 'U') != NULL);
  
! 	if (local && mode == PROC) {
! 		fclose(ifp);
! 		return FALSE;
  	}
  #ifdef DEBUG
  	printf("Transmitting to '%s'\n", sp->s_name);

--- 115,133 -----
  /* U:	useexist: use the -c option to uux to use the existing copy */
  	int useexist = (index(sp->s_flags, 'U') != NULL);
  
! 	if (local) {		/* allow local to mean within 'n' hops */
! 		++ptr;
! 		if (isdigit(*ptr))
! 			local = *ptr - '0';
! 		else
! 			local = 0;
! 		for (ptr = h.path; *ptr != '\0'; local--)
! 			while (*ptr++ != '\0')
! 				;
! 		if (local < 0) {
! 			fclose(ifp);
! 			return FALSE;
! 		}
  	}
  #ifdef DEBUG
  	printf("Transmitting to '%s'\n", sp->s_name);
-- 
	roger long
	pertec computer corp
	{ucbvax!unisoft | scgvaxd | trwrb | felix}!pertec!bytebug