Mercurial > noffle
comparison src/server.c @ 119:f50cc311e29a noffle
[svn] Leave online mode, if the connection to a remote server
fails for avoiding a series of timeouts and holding the lock for
a long time.
author | enz |
---|---|
date | Fri, 30 Jun 2000 08:10:45 +0100 |
parents | 3b4db42990e0 |
children | 3c71e28c8eef |
comparison
equal
deleted
inserted
replaced
118:ac9c0492daca | 119:f50cc311e29a |
---|---|
1 /* | 1 /* |
2 server.c | 2 server.c |
3 | 3 |
4 $Id: server.c 159 2000-06-24 20:47:40Z bears $ | 4 $Id: server.c 167 2000-06-30 07:10:45Z 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 |
235 if ( Fetch_init( Grp_server( grp ) ) ) | 235 if ( Fetch_init( Grp_server( grp ) ) ) |
236 { | 236 { |
237 Fetch_getNewArts( grp, OVER ); | 237 Fetch_getNewArts( grp, OVER ); |
238 Fetch_close(); | 238 Fetch_close(); |
239 } | 239 } |
240 else | |
241 { | |
242 Log_inf( "Connection to server failed. Leaving online mode." ); | |
243 Online_set( FALSE ); | |
244 } | |
240 } | 245 } |
241 | 246 |
242 static void | 247 static void |
243 postArts( void ) | 248 postArts( void ) |
244 { | 249 { |
357 findServer( msgId, s ); | 362 findServer( msgId, s ); |
358 if ( strcmp( s, "(unknown)" ) == 0 | 363 if ( strcmp( s, "(unknown)" ) == 0 |
359 || strcmp( s, GRP_LOCAL_SERVER_NAME ) == 0 ) | 364 || strcmp( s, GRP_LOCAL_SERVER_NAME ) == 0 ) |
360 return FALSE; | 365 return FALSE; |
361 if ( ! Client_connect( s ) ) | 366 if ( ! Client_connect( s ) ) |
367 { | |
368 Log_inf( "Connection to server failed. Leaving online mode." ); | |
369 Online_set( FALSE ); | |
362 return FALSE; | 370 return FALSE; |
371 } | |
363 Client_retrieveArt( msgId ); | 372 Client_retrieveArt( msgId ); |
364 Client_disconnect(); | 373 Client_disconnect(); |
365 return TRUE; | 374 return TRUE; |
366 } | 375 } |
367 | 376 |