comparison src/client.c @ 57:84e32c84666b noffle

[svn] add some intermediate variables for easier debugging in needsMark(). It seems that thread mode is sometimes not working.
author enz
date Fri, 12 May 2000 16:47:29 +0100
parents 125d79c9e586
children b4e6f7f96135
comparison
equal deleted inserted replaced
56:688bd51704e0 57:84e32c84666b
1 /* 1 /*
2 client.c 2 client.c
3 3
4 $Id: client.c 60 2000-05-09 22:28:38Z uh1763 $ 4 $Id: client.c 63 2000-05-12 15:47:29Z 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
625 } 625 }
626 626
627 static Bool 627 static Bool
628 needsMark( const char *ref ) 628 needsMark( const char *ref )
629 { 629 {
630 Bool done = FALSE; 630 Bool done = FALSE, interesting;
631 char *p; 631 char *p;
632 Str msgId; 632 Str msgId;
633 int stat, len; 633 int stat, len;
634 time_t lastAccess, nowTime; 634 time_t lastAccess, nowTime;
635 double limit; 635 double threadFollowTime, limit, age;
636 636
637 nowTime = time( NULL ); 637 nowTime = time( NULL );
638 limit = Cfg_threadFollowTime() * 24. * 3600.; 638 threadFollowTime = (double)Cfg_threadFollowTime();
639 limit = threadFollowTime * 24. * 3600.;
639 while ( ! done ) 640 while ( ! done )
640 { 641 {
641 p = msgId; 642 p = msgId;
642 while ( *ref != '<' ) 643 while ( *ref != '<' )
643 if ( *(ref++) == '\0' ) 644 if ( *(ref++) == '\0' )
653 *p = '\0'; 654 *p = '\0';
654 if ( Db_contains( msgId ) ) 655 if ( Db_contains( msgId ) )
655 { 656 {
656 stat = Db_stat( msgId ); 657 stat = Db_stat( msgId );
657 lastAccess = Db_lastAccess( msgId ); 658 lastAccess = Db_lastAccess( msgId );
658 if ( ( stat & DB_INTERESTING ) 659 interesting = ( stat & DB_INTERESTING );
659 && difftime( nowTime, lastAccess ) <= limit ) 660 age = difftime( nowTime, lastAccess );
661 if ( interesting && age <= limit )
660 return TRUE; 662 return TRUE;
661 } 663 }
662 } 664 }
663 return FALSE; 665 return FALSE;
664 } 666 }