[net.sources] Found: Patch for "L1" USENET news distribution

barry@adelie.UUCP (Barry A. Burke) (12/03/85)

Apologies to those of you for whom this is the umpteenth time you've
seen this go by, but...

Since I haven't seen the patch for "Ln" news distribution ("L"ocal
distribution of news from all sites ``n'' hops away), I thought I'd post
the context diff (suitable for patch(l)) of the code sent to me by Ken
Turkowski (ken@turtlevax.UUCP).  This patch applies to news 2.10.2.

Both Ken and Fred Avolio (avolio@decuac.UUCP) inform me that this patch
is indeed included in news 2.10.3.  Nobody has stood up to the net (yet)
as to when 2.10.3 might be out of beta test....

Here's the patch- to use it place a single-digit integer number of hops
immediately after the "L" in your sys file (eg. "L1" means send all
articles posted by your site and those posted by any site directly
connected to your site).  This is very useful for feeding "leaf" nodes
to a backbone which doesn't want another full relay feed.

Note that the line numbers probably won't match up with those in your
"ifuncs.c", as my version has several other patches...


-----------------chop chop, buzz buzz -----------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	ifuncs.pat
# This archive created: Mon Dec  2 22:19:58 1985
export PATH; PATH=/bin:$PATH
echo shar: extracting "'ifuncs.pat'" '(2079 characters)'
if test -f 'ifuncs.pat'
then
	echo shar: will not over-write existing file "'ifuncs.pat'"
else
sed 's/^X//' << \SHAR_EOF > 'ifuncs.pat'
X*** ifuncs.c.orig	Mon Dec  2 13:15:24 1985
X--- ifuncs.c	Mon Dec  2 13:15:41 1985
X***************
X*** 84,89
X  
X  /*
X   * Transmit file to system.
X   */
X  #define PROC 0004
X  transmit(sp, ifp, maynotify)
X
X--- 87,94 -----
X  
X  /*
X   * Transmit file to system.
X+  * 27 Dec 84:	pertec!bytebug changed "local" to mean article originated
X+  *		within 'n' hops of host.
X   */
X  #define PROC 0004
X  transmit(sp, ifp, maynotify)
X***************
X*** 105,111
X  /* F:	append name to file */
X  	int appfile = (index(sp->s_flags, 'F') != NULL);
X  /* L:	local: don't send the article unless it was generated locally */
X! 	int local = (index(sp->s_flags, 'L') != NULL);
X  /* N:	notify: don't send the article, just tell him we have it */
X  	int notify = maynotify && (index(sp->s_flags, 'N') != NULL);
X  /* S:	noshell: don't fork a shell to execute the xmit command */
X
X--- 110,116 -----
X  /* F:	append name to file */
X  	int appfile = (index(sp->s_flags, 'F') != NULL);
X  /* L:	local: don't send the article unless it was generated locally */
X! 	int local = ((ptr = index(sp->s_flags, 'L')) != NULL);
X  /* N:	notify: don't send the article, just tell him we have it */
X  	int notify = maynotify && (index(sp->s_flags, 'N') != NULL);
X  /* S:	noshell: don't fork a shell to execute the xmit command */
X***************
X*** 113,121
X  /* U:	useexist: use the -c option to uux to use the existing copy */
X  	int useexist = (index(sp->s_flags, 'U') != NULL);
X  
X! 	if (local && mode == PROC) {
X! 		fclose(ifp);
X! 		return FALSE;
X  	}
X  #ifdef DEBUG
X  	printf("Transmitting to '%s'\n", sp->s_name);
X
X--- 118,136 -----
X  /* U:	useexist: use the -c option to uux to use the existing copy */
X  	int useexist = (index(sp->s_flags, 'U') != NULL);
X  
X! 	if (local) {		/* allow local to mean within 'n' hops */
X! 		++ptr;
X! 		if (isdigit(*ptr))
X! 			local = *ptr - '0';
X! 		else
X! 			local = 0;
X! 		for (ptr = h.path; *ptr != '\0'; local--)
X! 			while (*ptr++ != '\0')
X! 				;
X! 		if (local < 0) {
X! 			fclose(ifp);
X! 			return FALSE;
X! 		}
X  	}
X  #ifdef DEBUG
X  	printf("Transmitting to '%s'\n", sp->s_name);
SHAR_EOF
if test 2079 -ne "`wc -c < 'ifuncs.pat'`"
then
	echo shar: error transmitting "'ifuncs.pat'" '(should have been 2079 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
LIVE:	Barry A. Burke, (617) 965-8480 x26
USPS:	Adelie Corporation, 288 Walnut St., Newtonville, MA  02160
UUCP:	..!{harvard | decvax!linus!axiom}!adelie!barry
ARPA:	adelie!barry@harvard.ARPA