

Interrupt kills current incoming batch???

Have option to get the current list of ALL newsgroups available at a given
server to a file.

Segfaults if lines in in.hosts are too long. Fixed?

Option for removing arbritary header item.

Looses in.coming spool?

colrm - replace it by sed

Pipe to rnews

error messages on long option use the short form=

SPOOL=/var/news/spool/articles
INCOMING=/var/news/spool/in.coming

INHOSTS and LOCKS in newsx.man
Options for INHOSTS and LOCKS, also in test*.rc

install:
if test -d $SPOOL/articles/in.hosts ; then
   mv $SPOOL/articles/in.hosts $INHOSTS
else
   if test ! -d $INHOSTS ; then
       mkdir $INHOSTS
   fi
fi

Test --ihave

INN lock directory controlled by innshellvars.

Document Flush spool:

	--flush "ctlinnd flush spoolname" or whatever...

To do nothing:
	--flush ""

Spool directly to rnews.....

Check if same article posted twice....
Auto-fixup out.going .tmp-file for C News too....

Have warning at spec. time (problem: only once... )

^C medfrer at pull_in blir delagt!
IKKE BRA!

I stedet kan man f.eks.
	Lese inn hele fila med malloc.
	Ha en peker.
	Flushe ut til pull_tmp.

Ved ^C etc:
	Tm ut resten av bufferet til pull_tmp
	Gjr som n....

--newline
Document

Case with many history misses, 28k:

   window==1	  129 articles
   window==10	   37 seconds
   window==16	   29 seconds
   window==50	   15 seconds
   window==100	   12 seconds
   window==1000    10 seconds

Many articles, 28k

window==1	  152 seconds
window==10	  227 seconds

Do free space check: MINFREE space.c

Option to control statistics

Output modes:
	1. To spool (as now)
	2. To rnews (fine for INN)
	3. To another NNTP host (using IHAVE)

Max article size - copy to temp file if bigger...

FAQ:
Info fra Faurot

LOCK for -f and -l options...

Make seperate lock mechanism for incoming? 

Implement window for NNTP requests and responses. Implement using "state
FIFO buffer" see SPEEDUP
	#define ST_GROUP 1  ???
	#define ST_STAT 2
	#define ST_ARTICLE 3

	struct {
	    int st_state;
	    char *st_group;
	    long st_article;
	} ;


	handlers:
		next_command:
			while room in window
			     more in current group?
			     yes: issue STAT
			     no: waiting for ST_GROUP?
				 no: issue GROUP
				 yes: go await_incoming
		await_incoming:
			switch:
		ST_GROUP
			update info on current group
			do next_command
		ST_STAT
			look up article in history
			if OK, issue ARTICLE
			go next_command
		ST_ARTICLE
			place article in incoming spool
			do next_command


OK: Signals
    TERM:
	stop fetching gracefully...
	unlock etc...

    Interrupt:
	?

    HUP:
	stop fetching gracefully...
	unlock etc...

OK: Modify the "ps" display to show where we are.

Add a user interrupt to display the current status.

How to fetch articles:

	1. Use the local "active" file as a basic.
	2. Mask this file with the files in "sys".
	3. For each group in the host active file, do: 
	   3a. If it is not in the local "active", do nothing,
	       and keep the entry as is.
	   3b. If it is there, fetch it.
	4. For each file that is in the local active, fetch it
	   from scratch (and add it to the host active file). Have
	   an option to omit this.
	5. Perhaps have some tags in the host active file to limit
	   fetching.

OK: Handle Xreffed articles.

Handle articles already present (by doing a database lookup).

configure.in Makefile.in
config.sub
config.guess
config.status


NEWSX: When posting with POST, check the from-field..

Handle Xref header, and don't use STAT. As an option.

See also:
gup4cnews

Perhaps use batcher mechanism instead:
--------------------------------------
  The batchparms  file	controls  _how_ outgoing  news	is  packed  and
  transported.	Since no pre-defined transport can create SOUP packets,
  we  must  define  a  new  one -  let's  call  it  viasoup.   We  skip
  compression, and use the standard batcher. Output should be packed to
  go to our provider - in my case oslonett.no

  batcher will pick up the news articles mentioned  in	a  file in  the
  out.going news area called togo and pipe them to this script. togo is
  created and maintained by your newsreader in cooperation with C-news.

  When	the  batcher  is  (eventually) invoked, it uses the togo file to
  find which articles should be batched up, and clears	it  after  use.
  See below for crontab entry and scripts.
----------------------------------


#if 0
    if (sock->is_telnet == 1) {
	sbuf[0] = IAC;
	sbuf[1] = DONT;
	sbuf[2] = TELOPT_ECHO; 
	n = send(sock->w_fd,sbuf,3,0);
	sock->is_telnet = 2;	
	sbuf[0] = IAC;
	sbuf[1] = DO;
	sbuf[2] = TELOPT_SGA; /* suppress go-ahead */
	n = send(sock->w_fd,sbuf,3,0);
	sbuf[0] = IAC;
	sbuf[1] = WILL;
	sbuf[2] = TELOPT_ECHO; 
	n = send(sock->w_fd,sbuf,3,0);
    } 
#endif

#if 0
	buf[0] = 0xff; /* IAC */
	buf[1] = 0xfd; /* DO */
	buf[2] = 0x03; /* SuppressGoAhead */

	n = recv(sock->r_fd,buf,sizeof(buf),0);
	log_msg(L_DEBUG3,"telnet recv %d: %d %d %d",n, buf[0], buf[1], buf[2]);
	buf[0] = 0xff; /* IAC */
	buf[1] = 0xfc; /* WONT */
	buf[2] = 0x25; /* Authen */
	n = send(sock->r_fd,buf,3,0);
	log_msg(L_DEBUG3,"telnet send %d: SGA",n);

	n = recv(sock->r_fd,buf,sizeof(buf),0);
	log_msg(L_DEBUG3,"telnet recv %d: %d %d %d",n, buf[0], buf[1], buf[2]);

	n = recv(sock->r_fd,buf,sizeof(buf),0);
	log_msg(L_DEBUG3,"telnet recv %d: %d %d %d",n, buf[0], buf[1], buf[2]);
	for (;;) {
	    n = recv(sock->r_fd,buf,3,0);
	    log_msg(L_DEBUG3,"telnet recv %d: %d %d %d",n, buf[0], buf[1], buf[2]);
	    if (n != 3) break;
	    if (buf[0]!=IAC) break;
	    switch (buf[1]) {
	    case WILL: 
	    case WONT:
		continue;
	    case DO:
	    case DONT:
		buf[1] = WONT;
		n = send(sock->r_fd,buf,3,0);
		log_msg(L_DEBUG3,"telnet send %d: %d %d %d",n, buf[0], buf[1], buf[2]);
		continue;
	    }
	    break;
	}
	sock->is_telnet = 1;
    }
#endif
    /* BUG: if the protocol is telnet: 
	      IAC DO SuppressGoAhead
    ----> 0x0 fffd03   WILL TTYPE
		    fffb18    WILL NAWS
			  fffb1f    WILL TSPEED
				fffb20
				      fffb21  WILL LINEMODE
					    fffb22  WILL OLD_ENVIRON
						  fffb24  DO STATUS
							fffd05

	      IAC DO AUTHEN
	< 0x0 fffd25
	      IAC WONT AUTHEN
    ----> 0x0 fffc25
								  SNDLOC
	< 0x0 fffb03fffd18fffd1ffffd20fffd21fffe22fffd24fffb05fffd23
	      IAC SB	     IAC SE  IAC ... SNDLOC
	> 0x0 fffa1f00500019 fff0    fffc23
	      IAC SB			      IAC SE
	< 0x0 fffa2001fff0fffa2401fff0fffa1801fff0
	      IAC SB
	> 0x0 fffa200033383430302c3338343030fff0fffa2400fff0fffa18004c494e5558
	      IAC SE (end subnegotiation)
    ----> 0x20 fff0

	      IAC DO ECHO
	< 0x0 fffd01
	      IAC WONT ECHO
    ----> 0x0 fffc01
	      IAC WILL ECHO
	< 0x0 fffb01 0d0a4c696e757820322e302e323520286269672e74686f756768742920
	< 0x20 287474797030290d0a0d0a
	      IAC DO ECHO
    ----> 0x0 fffd01
    
	 Linux 2.0.25 (big.thought) (ttyp0)
    
	< 0x0 0d0a
    
	< 0x0 626967206c6f67696e3a20
	big login:
    */
    /* BUG: if the protocol is login:
	    write(3, "\0", 1)	      
	    write(3, "username\0", 9) 
	    write(3, "username\0", 9) 
	    write(3, "linux/38400\0", 12)   
	    read(3, "\0", 1)		    
     */

 
