[dovecot-cvs] dovecot/src/pop3 client.c, 1.27, 1.28 mail-storage-callbacks.c, 1.5, 1.6

cras at dovecot.org cras at dovecot.org
Mon Jul 12 14:35:54 EEST 2004


Update of /home/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv2470/pop3

Modified Files:
	client.c mail-storage-callbacks.c 
Log Message:
Broke mailbox_sync() into iterator.



Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3/client.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- client.c	23 Jun 2004 18:33:22 -0000	1.27
+++ client.c	12 Jul 2004 11:35:51 -0000	1.28
@@ -38,6 +38,18 @@
 	o_stream_close(client->output);
 }
 
+static int sync_mailbox(struct mailbox *box)
+{
+	struct mailbox_sync_context *ctx;
+        struct mailbox_sync_rec sync_rec;
+	struct mailbox_status status;
+
+	ctx = mailbox_sync_init(box, 0);
+	while (mailbox_sync_next(ctx, &sync_rec) > 0)
+		;
+	return mailbox_sync_deinit(ctx, &status);
+}
+
 static int init_mailbox(struct client *client)
 {
 	struct mail_search_arg search_arg;
@@ -51,6 +63,10 @@
 	search_arg.type = SEARCH_ALL;
 
 	for (i = 0; i < 2; i++) {
+		if (sync_mailbox(client->mailbox) < 0) {
+			client_send_storage_error(client);
+			return FALSE;
+		}
 		if (mailbox_get_status(client->mailbox, STATUS_MESSAGES,
 				       &status) < 0) {
 			client_send_storage_error(client);
@@ -104,10 +120,6 @@
 
 		/* well, sync and try again */
 		mailbox_transaction_rollback(t);
-		if (mailbox_sync(client->mailbox, 0) < 0) {
-			client_send_storage_error(client);
-			return FALSE;
-		}
 	}
 
 	client_send_line(client, "-ERR [IN-USE] Couldn't sync mailbox.");

Index: mail-storage-callbacks.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3/mail-storage-callbacks.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mail-storage-callbacks.c	25 May 2004 17:50:36 -0000	1.5
+++ mail-storage-callbacks.c	12 Jul 2004 11:35:51 -0000	1.6
@@ -21,71 +21,8 @@
 {
 }
 
-static void expunge(struct mailbox *mailbox __attr_unused__,
-		    unsigned int seq, void *context)
-{
-	struct client *client = context;
-	unsigned char *mask = client->deleted_bitmask;
-	unsigned int max, i, j;
-
-	/* external deletes - we have to fix our internal deleted array.
-	   this should happen only when we're doing the expunging at quit. */
-	seq--;
-	client->messages_count--;
-
-	if (!client->deleted)
-		return;
-
-	max = client->messages_count / CHAR_BIT;
-	i = seq / CHAR_BIT; j = seq % CHAR_BIT;
-	mask[i] = (mask[i] & ((1 << j) - 1)) |
-		((mask[i] >> (j+1)) << j) |
-		(i == max ? 0 : ((mask[i+1] & 1) << (CHAR_BIT-1)));
-
-	if (i != max) {
-		for (i++; i < max-1; i++) {
-			mask[i] = (mask[i] >> 1) |
-				((mask[i+1] & 1) << (CHAR_BIT-1));
-		}
-
-		mask[i] >>= 1;
-	}
-}
-
-static void update_flags(struct mailbox *mailbox __attr_unused__,
-			 unsigned int seq __attr_unused__,
-			 const struct mail_full_flags *flags __attr_unused__,
-			 void *context __attr_unused__)
-{
-}
-
-static void message_count_changed(struct mailbox *mailbox __attr_unused__,
-				  unsigned int count __attr_unused__,
-				  void *context __attr_unused__)
-{
-}
-
-static void recent_count_changed(struct mailbox *mailbox __attr_unused__,
-				 unsigned int count __attr_unused__,
-				 void *context __attr_unused__)
-{
-}
-
-
-static void new_keywords(struct mailbox *mailbox __attr_unused__,
-			 const char *keywords[] __attr_unused__,
-			 unsigned int keywords_count __attr_unused__,
-			 void *context __attr_unused__)
-{
-}
-
 struct mail_storage_callbacks mail_storage_callbacks = {
 	alert_no_diskspace,
 	notify_ok,
-	notify_no,
-	expunge,
-	update_flags,
-	message_count_changed,
-	recent_count_changed,
-	new_keywords
+	notify_no
 };



More information about the dovecot-cvs mailing list