From ecb3845b2d525c1a6e9130b99201ace75f2ca6d0 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 5 Mar 2012 23:53:29 +0100 Subject: [PATCH] AdjRefCountList(): we de/increase the refcount of a number of messages at once. --- citadel/msgbase.c | 60 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/citadel/msgbase.c b/citadel/msgbase.c index a2110912c..143b6cb2a 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -68,6 +68,8 @@ struct addresses_to_be_filed *atbf = NULL; /* This temp file holds the queue of operations for AdjRefCount() */ static FILE *arcfp = NULL; +void AdjRefCountList(long *msgnum, long nmsg, int incr); + /* * These are the four-character field headers we use when outputting * messages in Citadel format (as opposed to RFC822 format). @@ -4781,11 +4783,12 @@ int CtdlDeleteMessages(char *room_name, /* which room */ * and we don't want that happening during an S_ROOMS critical * section. */ - if (num_deleted) for (i=0; i= 0) && (offset < the_size)) + { + rv = fwrite(new_arcq + offset, 1, the_size - offset, arcfp); + if (rv == -1) { + syslog(LOG_EMERG, "Couldn't write Refcount Queue File %s: %s\n", + file_arcq, + strerror(errno)); + } + else { + offset += rv; + } + } + free(new_arcq); + fflush(arcfp); + + return; +} + /* * TDAP_ProcessAdjRefCountQueue() -- 2.39.2