From e310a61bd53e030e3c6adcb24848adf096a3020f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 19 Dec 1998 19:02:48 +0000 Subject: [PATCH] * Added "-i" flag to netproc to make it skip the export phase. Updated other programs to call netproc in this way when appropriate. * Updated network.txt to reflect the usage for netproc (which has been wrong for several releases) --- citadel/ChangeLog | 6 ++++++ citadel/aidepost.c | 2 +- citadel/citmail.c | 2 +- citadel/file_ops.c | 2 +- citadel/msgbase.c | 2 +- citadel/netmailer.c | 1 + citadel/netproc.c | 24 ++++++++++++++++-------- citadel/network.txt | 17 +++++++++-------- citadel/rcit.c | 2 +- 9 files changed, 37 insertions(+), 21 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 72c2b3c56..4b129e866 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,9 @@ +Sat Dec 19 13:57:48 EST 1998 Art Cancro + * Added "-i" flag to netproc to make it skip the export phase. + Updated other programs to call netproc in this way when appropriate. + * Updated network.txt to reflect the usage for netproc (which has + been wrong for several releases) + Thu Dec 17 00:17:04 EST 1998 Art Cancro * Started removing the word "beta" from the docs and code. Preparing for an actual release. diff --git a/citadel/aidepost.c b/citadel/aidepost.c index 04b9b86ee..5c4ecdeae 100644 --- a/citadel/aidepost.c +++ b/citadel/aidepost.c @@ -59,7 +59,7 @@ int main(int argc, char **argv) snprintf(movecmd, sizeof movecmd, "/bin/mv %s %s", temptmp, tempspool); system(movecmd); - execlp("./netproc","netproc",NULL); + execlp("./netproc", "netproc", "-i", NULL); fprintf(stderr,"aidepost: could not run netproc\n"); exit(1); } diff --git a/citadel/citmail.c b/citadel/citmail.c index 9581ca199..0a80370f3 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -682,7 +682,7 @@ int main(int argc, char **argv) } closelog(); - if (RUN_NETPROC) execlp("./netproc","netproc",NULL); + if (RUN_NETPROC) execlp("./netproc", "netproc", "-i", NULL); exit(0); } diff --git a/citadel/file_ops.c b/citadel/file_ops.c index 3043737d4..e83ba34a9 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -220,7 +220,7 @@ void cmd_netf(char *cmdbuf) fclose(ofp); cprintf("%d File '%s' has been sent to %s.\n",OK,filename,destsys); - system("nohup ./netproc >/dev/null 2>&1 &"); + system("nohup ./netproc -i >/dev/null 2>&1 &"); return; } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 02df56809..51fbc20d4 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -825,7 +825,7 @@ void save_message(char *mtmp, /* file containing proper message */ sprintf(aaa,"./network/spoolin/netmail.%04x.%04x.%04x", getpid(), CC->cs_pid, ++seqnum); copy_file(mtmp,aaa); - system("exec nohup ./netproc >/dev/null 2>&1 &"); + system("exec nohup ./netproc -i >/dev/null 2>&1 &"); } /* Bump this user's messages posted counter. */ diff --git a/citadel/netmailer.c b/citadel/netmailer.c index 91b0573db..fc710020b 100644 --- a/citadel/netmailer.c +++ b/citadel/netmailer.c @@ -267,5 +267,6 @@ int main(int argc, char **argv) pclose(rmail); unlink(temp); /* get rid of the ASCII file */ + execlp("./netproc", "netproc", "-i", NULL); exit(0); /* go back to the main program */ } diff --git a/citadel/netproc.c b/citadel/netproc.c index bffc38942..61d0362db 100644 --- a/citadel/netproc.c +++ b/citadel/netproc.c @@ -1227,6 +1227,7 @@ int main(int argc, char **argv) char allst[32]; FILE *allfp; int a; + int import_only = 0; /* if set to 1, don't export anything */ strcpy(bbs_home_directory, BBSDIR); @@ -1240,8 +1241,12 @@ int main(int argc, char **argv) strcpy(bbs_home_directory, &bbs_home_directory[2]); home_specified = 1; } + if (!strcmp(argv[a], "-i")) { + import_only = 1; + } else { - fprintf(stderr, "netproc: usage: netproc [-hHomeDir]\n"); + fprintf(stderr, "netproc: usage: "); + fprintf(stderr, "netproc [-hHomeDir] [-i]\n"); exit(1); } } @@ -1272,16 +1277,19 @@ int main(int argc, char **argv) inprocess(); /* first collect incoming stuff */ - allfp=(FILE *)popen("cd ./network/systems; ls","r"); - if (allfp!=NULL) { - while (fgets(allst,32,allfp)!=NULL) { - allst[strlen(allst)-1] = 0; - outprocess(allst); + if (import_only != 1) { + allfp=(FILE *)popen("cd ./network/systems; ls","r"); + if (allfp!=NULL) { + while (fgets(allst,32,allfp)!=NULL) { + allst[strlen(allst)-1] = 0; + outprocess(allst); + } + pclose(allfp); } - pclose(allfp); + /* import again in case anything new was generated */ + inprocess(); } - inprocess(); /* incoming again in case anything new was generated */ rewrite_syslist(); printf("netproc: processing ended.\n"); cleanup(0); diff --git a/citadel/network.txt b/citadel/network.txt index 74532e82b..68c540506 100644 --- a/citadel/network.txt +++ b/citadel/network.txt @@ -72,18 +72,19 @@ the .ide ditRoom command. USING NETPROC - - Calling netproc with no arguments simply looks in the network/spoolin -directory for newly arrived messages, and posts them if it finds any. - To batch new messages and send them off to a remote system, the usage - - netproc sysname - - will do outbound network processing for system "sysname". It is recommended + + + Calling netproc with no arguments causes it to look in the network/spoolin +directory for newly arrived messages, and posts them if it finds any. It then +automatically batches up new messages on your system to be sent to your net +neighbors, and exports those messages to them. It is recommended that you use the cron program to handle your network processing on a routine basis automatically. Arrange with your netneighbors for both of your systems to batch new messages before actual polls take place, to guarantee that messages travel across the network as quickly as possible. + + Calling netproc with the -i flag causes it to skip the export phase, and +handle incoming messages only. NETWORKING WITH A USENET NEWS SITE diff --git a/citadel/rcit.c b/citadel/rcit.c index 60c073dc8..51917d0a4 100644 --- a/citadel/rcit.c +++ b/citadel/rcit.c @@ -232,7 +232,7 @@ END: putc(0,mout); fclose(mout); unlink(tname); if (compressed_input) pclose(minput); - if (!spool_only) execlp("./netproc","netproc",NULL); + if (!spool_only) execlp("./netproc", "netproc", "-i", NULL); exit(0); } -- 2.39.2