[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

solved posting problem - patch included - please incorporate




BACKGROUND: my news server requires authentication to either upload or
download news articles.  It only needs it done once per session, but will
accept more.

	Once I saw that my v1.5 patch had been credited in v1.8.1, I
believed all was good, and deleted my old patch.  So I'm not sure, but I
think the 'main()' in fetch.c v1.8.1 has been seriously re-arranged since
then.  Anyway, my patch was not *effectively* carried over to this
version, and v1.8.1 is different enough that the problem I experience now
is different than with v1.5.

v1.5 Problem: 
	a. would upload news just fine  
	b. would only download news if it had just uploaded news in the
	same run of fetch 
	WHY? authentication was only done during uploading! (step a)

v1.8.1 Problem:
	a. won't upload under any condition
	b. will download news just fine
	WHY? authentication is only done when downloading! (step b)


#1 My server gives response 201 upon connection - this means no posting.
   fetch.c just accepts this, and download news.  Posting is never tried
   again.

#2 Once I've authenticated myself, response is 200 - posting allowed.

	So with the following teeny-tiny patch, leafnode works perfectly
with my server, and should still work the same with everyone else's.  You
will see that I also added in one more item: syslog entry for the posting
action.  It's something I wanted.

PS:  Just in case the author feels I'm disrespecting him, I should mention
that I love the logging of "will fetch 3 articles" - it was really missing
from the older versions!


*** fetch.c.orig	Mon Feb  8 17:52:43 1999
--- fetch.c	Mon Feb  8 17:45:47 1999
***************
*** 1042,1049 ****
  	     S_ISREG( st.st_mode ) && getheaders( de->d_name ) &&
  	     isgrouponserver( headers[ H_NEWSGROUPS ] ) &&
  	     (f=fopen( de->d_name, "r" )) != NULL ) {
! 	    if ( verbose > 2 )
  		printf( "Posting %s...\n", de->d_name );
  	    sprintf( lineout, "POST\r\n" );
  	    putaline();
  	    r = nntpreply();
--- 1042,1051 ----
  	     S_ISREG( st.st_mode ) && getheaders( de->d_name ) &&
  	     isgrouponserver( headers[ H_NEWSGROUPS ] ) &&
  	     (f=fopen( de->d_name, "r" )) != NULL ) {
! 	    if ( verbose > 2 ) {
  		printf( "Posting %s...\n", de->d_name );
+ 		syslog( LOG_INFO, "Posting %s...",de->d_name );
+ 	    }
  	    sprintf( lineout, "POST\r\n" );
  	    putaline();
  	    r = nntpreply();
***************
*** 1313,1318 ****
--- 1315,1322 ----
  	    fflush( nntpout );
  	    if ( nntpreply() != 498 ) {
  		if ( reply == 200 )
+ 		    ( void ) postarticles();
+ 		else if ( authenticate() )
  		    ( void ) postarticles();
  		nntpactive( servers );
  				/* get list of newsgroups or new newsgroups */

___________________________________________________________________________
 Day 0x2C: God created plain-text documents.     And Lo! It was very good.
 Day 0x4AF1: somebody emailed me an MSWord file.                Sacrilege!


-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list