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

Re: [leafnode-list] Still fighting with delaybody mode



* Stefan Wiens <s.wi@xxxxxxx> [010127 09:01]:
> Juergen Salk <juergen.salk@xxxxxx> writes:
> 
> > I'm still having some problems with delaybody mode in
> > leafnode-2.0b8.
> > After some tweaking, I've managed to be able to download 
> > marked articles, but for some reason, the msgids of articles 
> > that were successfully downloaded, are always written back to 
> > the corresponding group files in the interesting.groups 
> > directory. So subsequent fetchnews runs will download 
> > additional copies of these articles.
> 
> ARTICLE <status-23.01.2001@xxxxxxx>
> 220 0 article <status-23.01.2001@xxxxxxx>
>     ^

Uhh, I see. Thanks.

> This flaw is not easily fixed, because getmarked() has no other way to
> check if the article was downloaded successfully.

Hmm, as far as I see, the value that getarticle() passes back
to its caller is either not checked or at most if it's non-zero.

As a workaround the following patch should be sufficient
(please correct me, if I'm wrong):

--- fetchnews.c.orig    Tue Jan 23 23:49:28 2001
+++ fetchnews.c Sun Jan 28 20:16:29 2001
@@ -898,7 +919,7 @@
     free( msgid );
 
     if ( l )
-       return artno;
+       return 1;               /* successfully received article */
     else
        return 0;               /* error receiving article */
 }

> Another problem of the current implementation is that an article which
> is not available on any upstream server (expired/canceled) will never
> be removed from the list.

Actually it will be the error messages of the upstream server, that are 
written back to the interesting.groups files. I've tried 
to fix that with the following patch, which seems to work for me. (Although
this does not remove any messages from the list, of course.)

--- fetchnews.c.orig    Tue Jan 23 23:49:28 2001
+++ fetchnews.c Sun Jan 28 20:16:29 2001
@@ -309,6 +309,7 @@
 static void getmarked( struct newsgroup* group ) {
     FILE *f;
     char *l;
+    char *mid;
     struct stringlist * failed = NULL;
     struct stringlist * ptr = NULL;
     char filename[ 1024 ];
@@ -323,13 +324,16 @@
     }
 
     while ( ( l = getaline( f ) ) != NULL ) {
+        mid = strdup( l );              /* Save msgid */
        putaline( "ARTICLE %s", l );
        if ( !getarticle( NULL ) )
-           appendtolist( &failed, &ptr, l );
+           appendtolist( &failed, &ptr, mid );
+        free( mid );
     }
     fclose( f );
 
     truncate( filename, (off_t)0 );    /* kill file contents */
+    
     if ( !failed )
        return;
 

Thanks again.

Best regards - Juergen.

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