Common subdirectories: ../nntp.1.5.0/common and ./common Common subdirectories: ../nntp.1.5.0/doc and ./doc Common subdirectories: ../nntp.1.5.0/inews and ./inews Only in .: nntp.1.5.C.diff Common subdirectories: ../nntp.1.5.0/rrnpatches and ./rrnpatches Common subdirectories: ../nntp.1.5.0/server and ./server Common subdirectories: ../nntp.1.5.0/support and ./support Common subdirectories: ../nntp.1.5.0/xfer and ./xfer Common subdirectories: ../nntp.1.5.0/xmit and ./xmit diff -r -c ../nntp.1.5.0/server/Makefile ./server/Makefile *** ../nntp.1.5.0/server/Makefile Fri Feb 26 02:47:58 1988 --- ./server/Makefile Tue Jun 6 23:15:49 1989 *************** *** 3,8 **** --- 3,9 ---- # SRVROBJ = main.o serve.o access.o access_inet.o access_dnet.o active.o \ + batch.o \ ahbs.o globals.o group.o help.o ihave.o list.o misc.o netaux.o \ newgroups.o newnews.o nextlast.o ngmatch.o post.o parsit.o scandir.o \ slave.o spawn.o strcasecmp.o subnet.o time.o xhdr.o fakesyslog.o \ *************** *** 9,14 **** --- 10,16 ---- ../common/version.o SRVRSRC = main.c serve.c access.c access_inet.c access_dnet.c active.c \ + batch.c \ ahbs.c globals.c group.c help.c ihave.c list.c misc.c netaux.c \ newgroups.c newnews.c nextlast.c ngmatch.c post.c parsit.c scandir.c \ slave.c spawn.c strcasecmp.c subnet.c time.c xhdr.c fakesyslog.c \ *************** *** 19,25 **** SRCS = ${SRVRSRC} # -ldbm here if you've #define'ed DBM in ../common/conf.h ! LIBS = CFLAGS = -O --- 21,27 ---- SRCS = ${SRVRSRC} # -ldbm here if you've #define'ed DBM in ../common/conf.h ! LIBS = -ldbm CFLAGS = -O Only in ./server: batch.c diff -r -c ../nntp.1.5.0/server/ihave.c ./server/ihave.c *** ../nntp.1.5.0/server/ihave.c Tue Jan 12 02:53:11 1988 --- ./server/ihave.c Tue Jun 6 23:15:52 1989 *************** *** 43,49 **** return; } ! retcode = spawn(rnews, "rnews", (char *) 0, CONT_XFER, ERR_XFERFAIL, errbuf) if (retcode <= 0) printf("%d %s\r\n", ERR_XFERFAIL, errbuf); else if (retcode > 0) --- 43,55 ---- return; } ! #ifdef UNBATCHED_INPUT ! retcode = spawn(rnews, "rnews", (char *) 0, CONT_XFER, ! ERR_XFERFAIL, errbuf); ! #else ! /* C news input hook */ ! retcode = batch_input_article(CONT_XFER, ERR_XFERFAIL, errbuf); ! #endif if (retcode <= 0) printf("%d %s\r\n", ERR_XFERFAIL, errbuf); else if (retcode > 0) diff -r -c ../nntp.1.5.0/server/misc.c ./server/misc.c *** ../nntp.1.5.0/server/misc.c Sun Feb 7 01:29:33 1988 --- ./server/misc.c Tue Jun 6 23:15:54 1989 *************** *** 82,88 **** * * Side effects: opens dbm database * (only once, keeps it open after that). - * Converts "msg_id" to lower case. */ #ifndef NDBM --- 82,87 ---- *************** *** 115,124 **** datum key, content; #endif USGHIST static FILE *hfp = NULL; /* history file, text version */ - - for (cp = msg_id; *cp != '\0'; ++cp) - if (isupper(*cp)) - *cp = tolower(*cp); #ifdef USGHIST hfp = fopen(histfile(msg_id), "r"); --- 114,119 ---- diff -r -c ../nntp.1.5.0/server/newnews.c ./server/newnews.c *** ../nntp.1.5.0/server/newnews.c Sat Feb 6 20:29:07 1988 --- ./server/newnews.c Tue Jun 6 23:15:57 1989 *************** *** 255,263 **** * Side effects: Seeks in history file, modifies line. */ ! seekuntil(fp, key, line, linesize) FILE *fp; ! char *key; char *line; int linesize; { --- 255,263 ---- * Side effects: Seeks in history file, modifies line. */ ! seekuntil(fp, akey, line, linesize) FILE *fp; ! char *akey; char *line; int linesize; { *************** *** 264,270 **** --- 264,273 ---- char datetime[32]; register int c; register long top, bot, mid; + extern long dtol(); + char key[30]; + (void) sprintf(key, "%ld", dtol(akey)); /* akey -> time_t in ascii */ bot = 0; (void) fseek(fp, 0L, 2); top = ftell(fp); *************** *** 327,332 **** --- 330,338 ---- } + /* + * C news version of getword. + */ getword(fp, w, line, linesize) FILE *fp; register char *w; *************** *** 334,369 **** int linesize; { register char *cp; if (fgets(line, linesize, fp) == NULL) return (0); ! if (cp = index(line, '\t')) { ! /* ! * The following gross hack is present because the history file date ! * format is braindamaged. They like "mm/dd/yy hh:mm", which is useless ! * for relative comparisons of dates using something like atoi() or ! * strcmp. So, this changes their format into yymmddhhmm. Sigh. ! * ! * 12345678901234 ("x" for cp[x]) ! * mm/dd/yy hh:mm (their lousy representation) ! * yymmddhhmm (our good one) ! * 0123456789 ("x" for w[x]) ! */ ! *cp = '\0'; ! (void) strncpy(w, cp+1, 15); ! w[0] = cp[7]; /* Years */ ! w[1] = cp[8]; ! w[2] = cp[1]; /* Months */ ! w[3] = cp[2]; ! w[4] = cp[4]; /* Days */ ! w[5] = cp[5]; ! w[6] = cp[10]; /* Hours */ ! w[7] = cp[11]; ! w[8] = cp[13]; /* Minutes */ ! w[9] = cp[14]; ! w[10] = '\0'; ! } else ! w[0] = '\0'; return (1); } --- 340,362 ---- int linesize; { register char *cp; + extern char *index(); if (fgets(line, linesize, fp) == NULL) return (0); ! w[0] = '\0'; /* in case of bad format */ ! if (cp = index(line, '\t')) { /* find 2nd field */ ! register char *endp; ! ! *cp++ = '\0'; ! endp = index(cp, '~'); /* end of date-received */ ! if (endp == NULL) ! endp = index(cp, '\t'); /* end of expiry */ ! if (endp != NULL) { ! (void) strncpy(w, cp, endp - cp); ! w[endp - cp] = '\0'; ! } ! } return (1); } diff -r -c ../nntp.1.5.0/server/serve.c ./server/serve.c *** ../nntp.1.5.0/server/serve.c Thu Feb 25 22:49:21 1988 --- ./server/serve.c Tue Jun 6 23:16:00 1989 *************** *** 237,244 **** --- 237,251 ---- printf("%d %s closing connection. Goodbye.\r\n", OK_GOODBYE, host); (void) fflush(stdout); + #ifndef UNBATCHED_INPUT + { + char errbuf[2 * NNTP_STRLEN]; + enqpartbatch(CONT_XFER, ERR_XFERFAIL, errbuf); + } + #endif + #ifdef LOG if (ferror(stdout)) syslog(LOG_ERR, "%s disconnect: %m", hostname); *************** *** 287,293 **** #ifdef PROFILE profile(); #endif - exit(0); } --- 294,299 ----