diff -c +recursive slurp.orig/Makefile slurp/Makefile *** slurp.orig/Makefile Mon Mar 15 00:03:23 1993 --- slurp/Makefile Thu Apr 29 19:32:31 1993 *************** *** 3,18 **** # # C compiler ! CC=cc # C compilation flags ! CFLAGS= -O -Xa -I/usr/local/src/cnews/dbz # Loader flags ! LDFLAGS= # Libraries needed ! LIBS= /usr/local/src/cnews/dbz/dbz.o -lnsl -lsocket # If you don't have syslog then uncomment these two lines #FAKESRC=fakesyslog.c --- 3,20 ---- # # C compiler ! CC=gcc + TERMHOME=/home/smilie/term + # C compilation flags ! CFLAGS= -O6 -m486 -DTERM -I$(TERMHOME) # Loader flags ! LDFLAGS= # Libraries needed ! LIBS= # If you don't have syslog then uncomment these two lines #FAKESRC=fakesyslog.c *************** *** 31,39 **** misc.c space.c fakesyslog.c conf.h slurp.h nntp.h fakesyslog.h \ Makefile slurp.sys slurp.1 HISTORY - slurp: ${OBJECT} ! ${CC} ${LDFLAGS} ${OBJECT} -o slurp ${LIBS} slurp.o: slurp.c slurp.h conf.h nntp.h newnews.o: newnews.c slurp.h conf.h nntp.h --- 33,40 ---- misc.c space.c fakesyslog.c conf.h slurp.h nntp.h fakesyslog.h \ Makefile slurp.sys slurp.1 HISTORY slurp: ${OBJECT} ! ${CC} ${LDFLAGS} ${OBJECT} dbz.o $(TERMHOME)/client.a -o slurp ${LIBS} slurp.o: slurp.c slurp.h conf.h nntp.h newnews.o: newnews.c slurp.h conf.h nntp.h diff -c +recursive slurp.orig/articles.c slurp/articles.c *** slurp.orig/articles.c Mon Mar 15 00:03:19 1993 --- slurp/articles.c Mon Apr 5 19:35:34 1993 *************** *** 262,267 **** --- 262,268 ---- switch (atoi (status)) { /* If missing, then add to missing list */ + case ERR_ACCESS: case ERR_NOART: misart++; newart--; diff -c +recursive slurp.orig/conf.h slurp/conf.h *** slurp.orig/conf.h Mon Mar 15 00:03:24 1993 --- slurp/conf.h Sun Mar 21 02:26:18 1993 *************** *** 32,39 **** usually a good place for them. The hostname will be added to the end of TIMFILE. */ ! #define SYSFILE "/usr/lib/news/slurp.sys" ! #define TIMFILE "/usr/lib/news/slurp." /* If SPEEDUP is defined then there will always be one ARTICLE request --- 32,39 ---- usually a good place for them. The hostname will be added to the end of TIMFILE. */ ! #define SYSFILE "/usr/local/lib/news/slurp.sys" ! #define TIMFILE "/usr/local/lib/news/slurp." /* If SPEEDUP is defined then there will always be one ARTICLE request *************** *** 62,68 **** /* The location of the news history file. */ ! #define HISTORY_FILE "/usr/lib/news/history" /* The database format used by the news history file. For modern C News --- 62,68 ---- /* The location of the news history file. */ ! #define HISTORY_FILE "/usr/local/lib/news/history" /* The database format used by the news history file. For modern C News *************** *** 76,82 **** /* The location of the rnews program. If defined, slurp will pipe batches of articles to rnews rather than creating batch files in INDIR */ ! /* #define RNEWS "/usr/bin/rnews" /* */ /* The place where incoming batches will be placed if RNEWS is not --- 76,82 ---- /* The location of the rnews program. If defined, slurp will pipe batches of articles to rnews rather than creating batch files in INDIR */ ! #define RNEWS "/bin/rnews" /* */ /* The place where incoming batches will be placed if RNEWS is not *************** *** 83,89 **** defined. This is usually /usr/spool/news/in.coming for C News and /var/spool/rnews for INN. */ ! #define INDIR "/var/spool/news/in.coming" /* The optimum size of a news batch. Normally this can be left at 300000L. --- 83,89 ---- defined. This is usually /usr/spool/news/in.coming for C News and /var/spool/rnews for INN. */ ! #define INDIR "/usr/spool/news/in.coming" /* The optimum size of a news batch. Normally this can be left at 300000L. *************** *** 98,104 **** needed so we can check if there is enough space before starting to build up another batch of articles. */ ! #define SPOOLDIR "/var/spool/news" /* If less then MINFREE blocks are available on the disk containing SPOOLDIR --- 98,104 ---- needed so we can check if there is enough space before starting to build up another batch of articles. */ ! #define SPOOLDIR "/usr/spool/news" /* If less then MINFREE blocks are available on the disk containing SPOOLDIR *************** *** 126,132 **** SVR3, sun, hpux, pyr, hp300, NeXT, linux, apollo, ultrix, __bsdi__ and CMU_MACH. For other systems you may need to amend space.c. */ ! #define SVR4 /* Change to int if your signal() is old and returns int instead of void */ --- 126,132 ---- SVR3, sun, hpux, pyr, hp300, NeXT, linux, apollo, ultrix, __bsdi__ and CMU_MACH. For other systems you may need to amend space.c. */ ! #undef SVR4 /* Change to int if your signal() is old and returns int instead of void */ diff -c +recursive slurp.orig/newnews.c slurp/newnews.c *** slurp.orig/newnews.c Mon Mar 15 00:03:20 1993 --- slurp/newnews.c Mon Mar 29 08:07:29 1993 *************** *** 255,261 **** char buf [NNTP_STRLEN]; /* Create a full string to send to the server */ ! (void) sprintf (buf, "NEWNEWS %s %s GMT %s", line, nn_time, nn_distributions); /* Do the actual NEWNEWS */ --- 255,264 ---- char buf [NNTP_STRLEN]; /* Create a full string to send to the server */ ! /* (void) sprintf (buf, "NEWNEWS %s %s GMT %s", line, nn_time, ! nn_distributions);*/ ! ! (void) sprintf (buf, "NEWNEWS %s %s %s", line, nn_time, nn_distributions); /* Do the actual NEWNEWS */ diff -c +recursive slurp.orig/sockets.c slurp/sockets.c *** slurp.orig/sockets.c Mon Mar 15 00:03:28 1993 --- slurp/sockets.c Mon Mar 29 07:27:37 1993 *************** *** 47,52 **** --- 47,57 ---- #include #include + #ifdef TERM + #include "includes.h" + #include "client.h" + #endif + #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif *************** *** 65,70 **** --- 70,76 ---- * returning a file descriptor for the socket. */ + #ifndef TERM int tcp_open (char *host, char *service) { *************** *** 125,130 **** --- 131,173 ---- return (sockfd); } + #else /* Term */ + int + tcp_open (char *host, char *service) + { + int sockfd, on; + unsigned long inaddr; + struct servent *sp; + struct hostent *hp; + int port; + + if ((sockfd = connect_server(0)) < 0) + { + perror("termirc: connect to term server"); + return(-3); + } + + if ((sp = getservbyname (service, "tcp")) == NULL) + { + log_ret ("tcp_open: Unknown service %s/tcp", service); + return (-1); + } + + port = ntohs(sp->s_port); + printf("Port number = '%u'\n", port); + + send_command(sockfd, C_PORT, 0, "%s:%d", host, port); + send_command(sockfd, C_DUMB, 1, 0); + + on = 1; + /* if (setsockopt (sockfd, SOL_SOCKET, SO_KEEPALIVE, + (char *) &on, sizeof (on)) < 0) + log_ret ("tcp_open: Can't set KEEPALIVE on socket");*/ + + return (sockfd); + } + + #endif /* * server_init - Open a connection to the NNTP server. Returns -1 if an diff -c +recursive slurp.orig/time.c slurp/time.c *** slurp.orig/time.c Mon Mar 15 00:03:29 1993 --- slurp/time.c Thu Apr 29 19:36:12 1993 *************** *** 58,64 **** /* Convert byte order if needed */ timebuf = ntohl (timebuf); ! if (debug_flag) (void) fprintf (stderr, "time is currently %ld at server %s\n", timebuf, hostname); --- 58,64 ---- /* Convert byte order if needed */ timebuf = ntohl (timebuf); ! if (debug_flag) (void) fprintf (stderr, "time is currently %ld at server %s\n", timebuf, hostname); *************** *** 65,71 **** /* Convert the time from seconds since 1900 to seconds since 1970 */ ! return ((time_t) (timebuf - 2208988800UL)); } /* END-OF-FILE */ --- 65,71 ---- /* Convert the time from seconds since 1900 to seconds since 1970 */ ! return ((time_t) (timebuf - 2208988800UL + 36000L)); } /* END-OF-FILE */