comparison src/server.c @ 237:f8a91e2b4060 noffle

[svn] * src/fetchlist.h,src/fetchlist.c,src/noffle.c: Provide fetchmode for groups on fetchlist. * src/server.c: When fetching overviews online from groups on the fetchlist, fetch them in the appropriate fetch mode for the group. E.g. if group mode is FULL, fetch overviews and put all articles on articles required list to be fetched on the next noffle --fetch.
author bears
date Thu, 14 Feb 2002 17:14:34 +0000
parents ffb1848a39db
children d70e9dd6b308
comparison
equal deleted inserted replaced
236:5ebb557435b2 237:f8a91e2b4060
1 /* 1 /*
2 server.c 2 server.c
3 3
4 $Id: server.c 342 2001-12-09 12:31:57Z bears $ 4 $Id: server.c 368 2002-02-14 17:14:34Z bears $
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
130 130
131 Grp_setLastAccess( server.grp ); 131 Grp_setLastAccess( server.grp );
132 if ( ! Grp_local ( server.grp ) && ! Online_true() ) 132 if ( ! Grp_local ( server.grp ) && ! Online_true() )
133 { 133 {
134 Fetchlist_read(); 134 Fetchlist_read();
135 if ( ! Fetchlist_contains( server.grp ) ) 135 if ( ! Fetchlist_contains( server.grp, NULL ) )
136 { 136 {
137 if ( Cfg_autoSubscribe() ) 137 if ( Cfg_autoSubscribe() )
138 { 138 {
139 if ( strcmp( Cfg_autoSubscribeMode( server.grp ), "full" ) == 0 ) 139 if ( strcmp( Cfg_autoSubscribeMode( server.grp ), "full" ) == 0 )
140 mode = FULL; 140 mode = FULL;
251 || Grp_local( grp ) 251 || Grp_local( grp )
252 || time( NULL ) - Grp_lastAccess( server.grp ) < 1800 ) 252 || time( NULL ) - Grp_lastAccess( server.grp ) < 1800 )
253 return; 253 return;
254 if ( Fetch_init( Grp_server( grp ) ) ) 254 if ( Fetch_init( Grp_server( grp ) ) )
255 { 255 {
256 Fetch_getNewArts( grp, OVER ); 256 FetchMode mode;
257
258 /*
259 * See if group is on the fetchlist and if so use that mode.
260 * That way we preserve the download semantics for groups on
261 * the fetchlist. If the group is not on the fetchlist use
262 * OVER to get just the overview info.
263 */
264 Fetchlist_read();
265 if ( ! Fetchlist_contains( grp, &mode ) )
266 mode = OVER;
267
268 Fetch_getNewArts( grp, mode );
257 Fetch_close(); 269 Fetch_close();
258 } 270 }
259 else 271 else
260 { 272 {
261 Log_inf( "Connection to server failed. Leaving online mode." ); 273 Log_inf( "Connection to server failed. Leaving online mode." );
279 291
280 static Bool 292 static Bool
281 needsPseudoGenInfo( const char *grp ) 293 needsPseudoGenInfo( const char *grp )
282 { 294 {
283 return ! ( Grp_local( grp ) 295 return ! ( Grp_local( grp )
284 || Fetchlist_contains( grp ) 296 || Fetchlist_contains( grp, NULL )
285 || Online_true() ); 297 || Online_true() );
286 } 298 }
287 299
288 static void 300 static void
289 readCont( const char *name ) 301 readCont( const char *name )