[net.news] How to fix notes to NOT generate new "orphaned responses"

berry@zinfandel.UUCP (Berry Kercheval) (06/25/85)

Attention Notes system maintainers:

If you apply this fix to 'newsinput.c' your site will not generate any more
of those obnoxious 'Orphaned Response' messages everyone is ignoring.

This fix will not deal with incoming articles already titled "Re: Orphaned
Response -(nf)" but at least you will no longer be a part of the problem.

You should be able to feed this context diff into patch(1).
If you do not have patch, five minutes in your editor and a make will
fix you up.
	--berry
-----cut here------
*** newsinput.c	Fri Oct 21 11:11:54 1983
--- onewsinput.c	Mon Apr 11 10:43:25 1983
***************
*** 134,149
      j = i;					/* start at rhs */
  
      while (j && (line[j] != '!') && (line[j] != ':') && (line[j] != '.'))
!     {
! 	if ( line[j] == ')' ) {
! 	    while ( j && (line[j] != '(' ))	/* skip over Realnames in parens
! 						 * from 2.9 news */
! 		j--;
! 	}
! 	j--;					/* back to sys */
!     }
! 
!     atcount = 0;				/* count ARPA hosts parsed */
      for (i = 0, j++; (i < NAMESZ); i++)
  	if ((auth.aname[i] = line[j + i]) == '@' && atcount++)
  	{

--- 133,140 -----
  	while (getc (rawnews) != '\n');			/* make sure is end */
      j = i;						/* start at rhs */
      while (j && (line[j] != '!') && (line[j] != ':') && (line[j] != '.'))
! 	j--;						/* back to sys */
!     atcount = 0;					/* count ARPA hosts parsed */
      for (i = 0, j++; (i < NAMESZ); i++)
  	if ((auth.aname[i] = line[j + i]) == '@' && atcount++)
  	{
***************
*** 159,169
  	    else
  		if (auth.aname[i] == 0)
  		    break;
! 						/* build the from system */
!     for (i = 0; (i < SYSSZ - 1) &&
! 		line[i] != '!' && 
! 		line[i] != ':' && 
! 		line[i] != '.'; i++)
  	fromsys[i] = line[i];
      fromsys[i] = '\0';
  

--- 150,157 -----
  	    else
  		if (auth.aname[i] == 0)
  		    break;
! 							/* build the from system */
!     for (i = 0; (i < SYSSZ - 1) && line[i] != '!' && line[i] != ':' && line[i] != '.'; i++)
  	fromsys[i] = line[i];
      fromsys[i] = '\0';
  
***************
*** 459,465
  		    copydate (&entered, &note.n_date);
  		    gettime (&whentime);		/* get current time */
  		    status = ORPHND + FRMNEWS;		/* combo there */
- #ifdef notdef
  		    for (i = 0, p = "Orphaned Response"; (i < TITLEN) && *p; p++, i++)
  			note.ntitle[i] = *p;
  		    for (; i < TITLEN; i++)

--- 447,452 -----
  		    copydate (&entered, &note.n_date);
  		    gettime (&whentime);		/* get current time */
  		    status = ORPHND + FRMNEWS;		/* combo there */
  		    for (i = 0, p = "Orphaned Response"; (i < TITLEN) && *p; p++, i++)
  			note.ntitle[i] = *p;
  		    for (; i < TITLEN; i++)
***************
*** 465,470
  		    for (; i < TITLEN; i++)
  			note.ntitle[i] = ' ';
  							/* pad */
  		    where.addr = 0;			/* no text */
  		    notenum = putnote (&io, &where, note.ntitle, status,
  			    &note, &note.n_auth, NOPOLICY, NOLOCKIT, NOADDID, fromsys, ADDTIME);

--- 452,458 -----
  		    for (; i < TITLEN; i++)
  			note.ntitle[i] = ' ';
  							/* pad */
+ 
  		    where.addr = 0;			/* no text */
  		    notenum = putnote (&io, &where, note.ntitle, status,
  			    &note, &note.n_auth, NOPOLICY, NOLOCKIT, NOADDID, fromsys, ADDTIME);
***************
*** 468,495
  		    where.addr = 0;			/* no text */
  		    notenum = putnote (&io, &where, note.ntitle, status,
  			    &note, &note.n_auth, NOPOLICY, NOLOCKIT, NOADDID, fromsys, ADDTIME);
- #else
- 		    for (i = length; i < TITLEN; i++)
- 		        title[i] = ' ';			/* space fill */
- 		    where.addr = 0;			/* no text */
- 		    {
- 			FILE *fp;
- 
- 			fp = fopen("/ff/notes/.utilities/orphanlog", "a");
- 			if ( fp != NULL ) {
- 			    fprintf (fp,"Orphaned response from news.  ");
- 			    fprintf (fp,"Creating empty base note:\n");
- 			    fprintf (fp,"\tSystem: %s\n", fromsys);
- 			    fprintf (fp,"\tTitle: \"%s\"\n", title);
- 			    fprintf (fp,"Orphans so far: %d\n", io.norphans);
- 			    fprintf (fp,"----------------------\n\n");
- 			    fclose (fp);
- 			}
- 		    }
- 		    notenum = putnote (&io, &where, title, status,
- 			    &note, &note.n_auth, NOPOLICY, NOLOCKIT, 
- 			    NOADDID, fromsys, ADDTIME);
- #endif
  		    io.norphans++;			/* census of orphans */
  		    getnrec (&io, notenum, &note2);     /* get good one */
  		}

--- 456,461 -----
  		    where.addr = 0;			/* no text */
  		    notenum = putnote (&io, &where, note.ntitle, status,
  			    &note, &note.n_auth, NOPOLICY, NOLOCKIT, NOADDID, fromsys, ADDTIME);
  		    io.norphans++;			/* census of orphans */
  		    getnrec (&io, notenum, &note2);     /* get good one */
  		}

----end of patch-------
-- 
Berry Kercheval		Zehntel Inc.	(ihnp4!zehntel!zinfandel!berry)
(415)932-6900				(kerch@lll-tis.ARPA)