From: Wilfried Goesgens Date: Mon, 5 Mar 2012 22:53:29 +0000 (+0100) Subject: AdjRefCountList(): we de/increase the refcount of a number of messages at once. X-Git-Tag: v8.11~141 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=ecb3845b2d525c1a6e9130b99201ace75f2ca6d0;p=citadel.git AdjRefCountList(): we de/increase the refcount of a number of messages at once. --- 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()