diff src/fetch.c @ 120:05f50c1761d9 noffle

[svn] Applied patch from Matija Nalis: Counters for monitoring --fetch progress.
author enz
date Wed, 19 Jul 2000 08:02:45 +0100
parents 38b0a1532a37
children 3c71e28c8eef
line wrap: on
line diff
--- a/src/fetch.c	Fri Jun 30 08:10:45 2000 +0100
+++ b/src/fetch.c	Wed Jul 19 08:02:45 2000 +0100
@@ -1,7 +1,7 @@
 /*
   fetch.c
 
-  $Id: fetch.c 135 2000-06-05 08:57:05Z bears $
+  $Id: fetch.c 174 2000-07-19 07:02:45Z enz $
 */
 
 #if HAVE_CONFIG_H
@@ -153,11 +153,13 @@
     Str msgId;
     DynStr *list;
     const char *p;
-    int count = 0;
+    int count = 0, artcnt = 0, artmax = 0;
 
     ASSERT( fetch.ready );
     Log_dbg( "Retrieving articles marked for download" );
     list = new_DynStr( 10000 );
+    if ( Req_first( fetch.serv, msgId ) ) do { artmax++; } while ( Req_next( msgId ) );
+    Log_inf( "%d TOTAL messages to download", artmax);
     if ( Req_first( fetch.serv, msgId ) )
         do
         {
@@ -165,7 +167,7 @@
             if ( ++count % 20 == 0 ) /* Send max. 20 ARTICLE cmds at once */
             {
                 p = DynStr_str( list );
-                Client_retrieveArtList( p );
+                Client_retrieveArtList( p, &artcnt, artmax );
                 while ( ( p = Utl_getLn( msgId, p ) ) )
                     Req_remove( fetch.serv, msgId );
                 DynStr_clear( list );
@@ -173,7 +175,7 @@
         }
         while ( Req_next( msgId ) );
     p = DynStr_str( list );
-    Client_retrieveArtList( p );
+    Client_retrieveArtList( p, &artcnt, artmax );
     while ( ( p = Utl_getLn( msgId, p ) ) )
         Req_remove( fetch.serv, msgId );
     del_DynStr( list );