comparison src/server.c @ 271:3477050e8d10 noffle

[svn] * src/client.c,src/fetch.c,src/lock.c.src/protocol.c,src/util.h,src/util.c: Define our own SignalHandler type rather than use the rather Linux-specific (and potentially glibc version specific) sig_t. * src/client.c,src/database.h,src/database.c,src/over.h,src/over.c, src/pseudo.c,src/server.c: Ensure format string specifiers and passed data types match. As part of this, change some uses of size_t as a general data type to an appropriate base C type. Database status changes from int to unsigned.
author bears
date Sun, 10 Nov 2002 11:32:17 +0000
parents b3a2f710fe2c
children c02c4eb95f95
comparison
equal deleted inserted replaced
270:d6fedc09b052 271:3477050e8d10
1 /* 1 /*
2 server.c 2 server.c
3 3
4 $Id: server.c 401 2002-10-25 11:04:57Z bears $ 4 $Id: server.c 403 2002-11-10 11:32:17Z 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
503 } 503 }
504 504
505 static void 505 static void
506 touchArticle( const char *msgId ) 506 touchArticle( const char *msgId )
507 { 507 {
508 int status = Db_status( msgId ); 508 unsigned status = Db_status( msgId );
509 status |= DB_INTERESTING; 509 status |= DB_INTERESTING;
510 Db_setStatus( msgId, status ); 510 Db_setStatus( msgId, status );
511 Db_updateLastAccess( msgId ); 511 Db_updateLastAccess( msgId );
512 } 512 }
513 513
541 541
542 static void 542 static void
543 updateArt( const char *msgId ) 543 updateArt( const char *msgId )
544 /* retrieve Article if in online mode */ 544 /* retrieve Article if in online mode */
545 { 545 {
546 int stat; 546 unsigned status;
547 547
548 touchArticle( msgId ); 548 touchArticle( msgId );
549 touchReferences( msgId ); 549 touchReferences( msgId );
550 stat = Db_status( msgId ); 550 status = Db_status( msgId );
551 if ( Online_true() && ( stat & DB_NOT_DOWNLOADED ) ) 551 if ( Online_true() && ( status & DB_NOT_DOWNLOADED ) )
552 { 552 {
553 retrieveArt( msgId ); 553 retrieveArt( msgId );
554 } 554 }
555 } 555 }
556 556
557 static void 557 static void
558 doBodyInDb( const char *msgId ) 558 doBodyInDb( const char *msgId )
559 { 559 {
560 int stat; 560 unsigned status;
561 Str srv; 561 Str srv;
562 562
563 stat = Db_status( msgId ); 563 status = Db_status( msgId );
564 if ( stat & DB_RETRIEVING_FAILED ) 564 if ( status & DB_RETRIEVING_FAILED )
565 { 565 {
566 Db_setStatus( msgId, stat & ~DB_RETRIEVING_FAILED ); 566 Db_setStatus( msgId, status & ~DB_RETRIEVING_FAILED );
567 putTxtBuf( Db_body( msgId ) ); 567 putTxtBuf( Db_body( msgId ) );
568 } 568 }
569 else if ( stat & DB_NOT_DOWNLOADED ) 569 else if ( status & DB_NOT_DOWNLOADED )
570 { 570 {
571 findServer( msgId, srv ); 571 findServer( msgId, srv );
572 if ( Req_contains( srv, msgId ) ) 572 if ( Req_contains( srv, msgId ) )
573 putTxtBuf( Pseudo_alreadyMarkedBody() ); 573 putTxtBuf( Pseudo_alreadyMarkedBody() );
574 else if ( strcmp( srv, "(unknown)" ) != 0 && 574 else if ( strcmp( srv, "(unknown)" ) != 0 &&
1193 break; 1193 break;
1194 case REF: 1194 case REF:
1195 Utl_cpyStr( res, Ov_ref( ov ) ); 1195 Utl_cpyStr( res, Ov_ref( ov ) );
1196 break; 1196 break;
1197 case BYTES: 1197 case BYTES:
1198 snprintf( res, MAXCHAR, "%d", Ov_bytes( ov ) ); 1198 snprintf( res, MAXCHAR, "%ld", Ov_bytes( ov ) );
1199 break; 1199 break;
1200 case LINES: 1200 case LINES:
1201 snprintf( res, MAXCHAR, "%d", Ov_lines( ov ) ); 1201 snprintf( res, MAXCHAR, "%ld", Ov_lines( ov ) );
1202 break; 1202 break;
1203 case XREF: 1203 case XREF:
1204 msgId = Ov_msgId( ov ); 1204 msgId = Ov_msgId( ov );
1205 /* 1205 /*
1206 * Gen info messages don't have an Xref header. When INN is asked 1206 * Gen info messages don't have an Xref header. When INN is asked