Mercurial > noffle
comparison src/fetch.c @ 155:22b81617d427 noffle
[svn] applied patch from Matija Nalis: better handling of inconsistent counters
at remote server; do not read overview on each group command
| author | enz |
|---|---|
| date | Tue, 05 Dec 2000 19:50:09 +0000 |
| parents | b2a4f839affd |
| children | 09ca6eb5c7ff |
comparison
equal
deleted
inserted
replaced
| 154:b2a4f839affd | 155:22b81617d427 |
|---|---|
| 1 /* | 1 /* |
| 2 fetch.c | 2 fetch.c |
| 3 | 3 |
| 4 $Id: fetch.c 235 2000-12-05 19:30:50Z enz $ | 4 $Id: fetch.c 236 2000-12-05 19:50:09Z enz $ |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
| 8 #include <config.h> | 8 #include <config.h> |
| 9 #endif | 9 #endif |
| 79 | 79 |
| 80 /* Databases open on entry, closed on exit. */ | 80 /* Databases open on entry, closed on exit. */ |
| 81 static void | 81 static void |
| 82 fetchNewArts( const char *name, FetchMode mode ) | 82 fetchNewArts( const char *name, FetchMode mode ) |
| 83 { | 83 { |
| 84 int next, first, last; | 84 int next, first, last, refetch; |
| 85 | 85 |
| 86 if ( ! Client_changeToGrp( name ) ) | 86 if ( ! Client_changeToGrp( name ) ) |
| 87 { | 87 { |
| 88 Log_err( "Could not change to group %s", name ); | 88 Log_err( "Could not change to group %s", name ); |
| 89 if ( Lock_gotLock() ) | 89 if ( Lock_gotLock() ) |
| 111 Lock_closeDatabases(); | 111 Lock_closeDatabases(); |
| 112 return; | 112 return; |
| 113 } | 113 } |
| 114 if ( next > last + 1 ) | 114 if ( next > last + 1 ) |
| 115 { | 115 { |
| 116 Log_err( "Article number inconsistent (%s rmt=%lu-%lu, next=%lu)", | 116 refetch = last - Cfg_maxFetch() + 1; |
| 117 name, first, last, next ); | 117 if ( refetch < 0 ) refetch = 1; |
| 118 Pseudo_cntInconsistent( name, first, last, next ); | 118 Log_err( "Article number inconsistent (%s rmt=%lu-%lu, next=%lu). Refetching from %lu", |
| 119 name, first, last, next, refetch ); | |
| 120 Pseudo_cntInconsistent( name, first, last, next, refetch ); | |
| 121 first = refetch; | |
| 119 } | 122 } |
| 120 else if ( next < first ) | 123 else if ( next < first ) |
| 121 { | 124 { |
| 122 Log_inf( "Missing articles (%s first=%lu next=%lu)", | 125 Log_inf( "Missing articles (%s first=%lu next=%lu)", |
| 123 name, first, next ); | 126 name, first, next ); |
