comparison src/client.c @ 61:adf0af5152f7 noffle

[svn] Renamed some variables and function names, because they caused compiler warnings because of shadowing global variables from system include files (index, stat, serv).
author enz
date Fri, 12 May 2000 18:19:38 +0100
parents b4e6f7f96135
children 2e47992d7f5c
comparison
equal deleted inserted replaced
60:defaa632baae 61:adf0af5152f7
1 /* 1 /*
2 client.c 2 client.c
3 3
4 $Id: client.c 64 2000-05-12 16:52:07Z enz $ 4 $Id: client.c 67 2000-05-12 17:19:38Z 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
409 Grp_setServ( grp, client.serv ); 409 Grp_setServ( grp, client.serv );
410 Grp_setPostAllow( grp, postAllow ); 410 Grp_setPostAllow( grp, postAllow );
411 } 411 }
412 else 412 else
413 { 413 {
414 if ( Cfg_servIsPreferential( client.serv, Grp_serv( grp ) ) ) 414 if ( Cfg_servIsPreferential( client.serv, Grp_server( grp ) ) )
415 { 415 {
416 Log_inf( "Changing server for '%s': '%s'->'%s'", 416 Log_inf( "Changing server for '%s': '%s'->'%s'",
417 grp, Grp_serv( grp ), client.serv ); 417 grp, Grp_server( grp ), client.serv );
418 Grp_setServ( grp, client.serv ); 418 Grp_setServ( grp, client.serv );
419 Grp_setRmtNext( grp, first ); 419 Grp_setRmtNext( grp, first );
420 Grp_setPostAllow( grp, postAllow ); 420 Grp_setPostAllow( grp, postAllow );
421 } 421 }
422 else 422 else
423 Log_dbg( "Group %s is already fetched from %s", 423 Log_dbg( "Group %s is already fetched from %s",
424 grp, Grp_serv( grp ) ); 424 grp, Grp_server( grp ) );
425 425
426 } 426 }
427 } 427 }
428 if ( ! err ) 428 if ( ! err )
429 { 429 {
628 needsMark( const char *ref ) 628 needsMark( const char *ref )
629 { 629 {
630 Bool done = FALSE, interesting; 630 Bool done = FALSE, interesting;
631 char *p; 631 char *p;
632 Str msgId; 632 Str msgId;
633 int stat, len; 633 int status, len;
634 time_t lastAccess, nowTime; 634 time_t lastAccess, nowTime;
635 double threadFollowTime, limit, age; 635 double threadFollowTime, limit, age;
636 636
637 nowTime = time( NULL ); 637 nowTime = time( NULL );
638 threadFollowTime = (double)Cfg_threadFollowTime(); 638 threadFollowTime = (double)Cfg_threadFollowTime();
652 } 652 }
653 *(p++) = '>'; 653 *(p++) = '>';
654 *p = '\0'; 654 *p = '\0';
655 if ( Db_contains( msgId ) ) 655 if ( Db_contains( msgId ) )
656 { 656 {
657 stat = Db_stat( msgId ); 657 status = Db_status( msgId );
658 lastAccess = Db_lastAccess( msgId ); 658 lastAccess = Db_lastAccess( msgId );
659 interesting = ( stat & DB_INTERESTING ); 659 interesting = ( status & DB_INTERESTING );
660 age = difftime( nowTime, lastAccess ); 660 age = difftime( nowTime, lastAccess );
661 if ( interesting && age <= limit ) 661 if ( interesting && age <= limit )
662 return TRUE; 662 return TRUE;
663 } 663 }
664 } 664 }
683 if ( p == NULL ) 683 if ( p == NULL )
684 Log_err( "Overview with no group in Xref '%s'", msgId ); 684 Log_err( "Overview with no group in Xref '%s'", msgId );
685 else 685 else
686 { 686 {
687 /* TODO: This code block seems unnessesary. Can we remove it? */ 687 /* TODO: This code block seems unnessesary. Can we remove it? */
688 if ( Cfg_servIsPreferential( client.serv, Grp_serv( g ) ) ) 688 if ( Cfg_servIsPreferential( client.serv, Grp_server( g ) ) )
689 { 689 {
690 Log_dbg( "Changing first server for '%s' from '%s' to '%s'", 690 Log_dbg( "Changing first server for '%s' from '%s' to '%s'",
691 msgId, Grp_serv( g ), client.serv ); 691 msgId, Grp_server( g ), client.serv );
692 snprintf( t, MAXCHAR, "%s:%d %s", 692 snprintf( t, MAXCHAR, "%s:%d %s",
693 client.grp, Ov_numb( ov ), xref ); 693 client.grp, Ov_numb( ov ), xref );
694 Db_setXref( msgId, t ); 694 Db_setXref( msgId, t );
695 } 695 }
696 else 696 else
754 } 754 }
755 755
756 static void 756 static void
757 retrievingFailed( const char* msgId, const char *reason ) 757 retrievingFailed( const char* msgId, const char *reason )
758 { 758 {
759 int stat; 759 int status;
760 760
761 Log_err( "Retrieving of %s failed: %s", msgId, reason ); 761 Log_err( "Retrieving of %s failed: %s", msgId, reason );
762 stat = Db_stat( msgId ); 762 status = Db_status( msgId );
763 Pseudo_retrievingFailed( msgId, reason ); 763 Pseudo_retrievingFailed( msgId, reason );
764 Db_setStat( msgId, stat | DB_RETRIEVING_FAILED ); 764 Db_setStatus( msgId, status | DB_RETRIEVING_FAILED );
765 } 765 }
766 766
767 static Bool 767 static Bool
768 retrieveAndStoreArt( const char *msgId ) 768 retrieveAndStoreArt( const char *msgId )
769 { 769 {
789 if ( ! Db_contains( msgId ) ) 789 if ( ! Db_contains( msgId ) )
790 { 790 {
791 Log_err( "Article '%s' not prepared in database. Skipping.", msgId ); 791 Log_err( "Article '%s' not prepared in database. Skipping.", msgId );
792 return; 792 return;
793 } 793 }
794 if ( ! ( Db_stat( msgId ) & DB_NOT_DOWNLOADED ) ) 794 if ( ! ( Db_status( msgId ) & DB_NOT_DOWNLOADED ) )
795 { 795 {
796 Log_inf( "Article '%s' already retrieved. Skipping.", msgId ); 796 Log_inf( "Article '%s' already retrieved. Skipping.", msgId );
797 return; 797 return;
798 } 798 }
799 if ( ! putCmd( "ARTICLE %s", msgId ) ) 799 if ( ! putCmd( "ARTICLE %s", msgId ) )
816 p = list; 816 p = list;
817 while ( ( p = Utl_getLn( msgId, p ) ) ) 817 while ( ( p = Utl_getLn( msgId, p ) ) )
818 if ( ! Db_contains( msgId ) ) 818 if ( ! Db_contains( msgId ) )
819 Log_err( "Skipping retrieving of %s (not prepared in database)", 819 Log_err( "Skipping retrieving of %s (not prepared in database)",
820 msgId ); 820 msgId );
821 else if ( ! ( Db_stat( msgId ) & DB_NOT_DOWNLOADED ) ) 821 else if ( ! ( Db_status( msgId ) & DB_NOT_DOWNLOADED ) )
822 Log_inf( "Skipping %s (already retrieved)", msgId ); 822 Log_inf( "Skipping %s (already retrieved)", msgId );
823 else if ( ! putCmdNoFlush( "ARTICLE %s", msgId ) ) 823 else if ( ! putCmdNoFlush( "ARTICLE %s", msgId ) )
824 { 824 {
825 retrievingFailed( msgId, "Connection broke down" ); 825 retrievingFailed( msgId, "Connection broke down" );
826 del_DynStr( s ); 826 del_DynStr( s );