Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site pertec.UUCP Path: utzoo!utcs!lsuc!pesnta!pertec!bytebug From: bytebug@pertec.UUCP (roger long) Newsgroups: net.news,net.news.b Subject: Extension to L (local) flag in sys file - corrected patch Message-ID: <323@pertec.UUCP> Date: Sun, 19-May-85 10:10:56 EDT Article-I.D.: pertec.323 Posted: Sun May 19 10:10:56 1985 Date-Received: Sun, 19-May-85 19:19:33 EDT Distribution: net Organization: Pertec Computer Corp., Irvine, CA Lines: 119 Xref: utcs net.news:2989 net.news.b:977 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