[dovecot-cvs] dovecot/src/pop3 client.c,1.24,1.25

cras at procontrol.fi cras at procontrol.fi
Sun May 30 08:09:49 EEST 2004


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

Modified Files:
	client.c 
Log Message:
assert fix



Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3/client.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- a/client.c	22 May 2004 22:36:46 -0000	1.24
+++ b/client.c	30 May 2004 05:09:47 -0000	1.25
@@ -47,25 +47,27 @@
 	struct mailbox_status status;
 	int i, failed;
 
-	if (mailbox_get_status(client->mailbox,
-			       STATUS_MESSAGES | STATUS_UIDVALIDITY,
-			       &status) < 0) {
-		client_send_storage_error(client);
-		return FALSE;
-	}
-
-	client->messages_count = status.messages;
-	client->deleted_size = 0;
-	client->uidvalidity = status.uidvalidity;
-
-	if (client->messages_count == 0)
-		return TRUE;
-
 	memset(&search_arg, 0, sizeof(search_arg));
 	search_arg.type = SEARCH_ALL;
 
-	client->message_sizes = i_new(uoff_t, client->messages_count);
 	for (i = 0; i < 2; i++) {
+		if (mailbox_get_status(client->mailbox,
+				       STATUS_MESSAGES | STATUS_UIDVALIDITY,
+				       &status) < 0) {
+			client_send_storage_error(client);
+			return FALSE;
+		}
+
+		client->messages_count = status.messages;
+		client->deleted_size = 0;
+		client->uidvalidity = status.uidvalidity;
+
+		if (client->messages_count == 0)
+			return TRUE;
+
+		i_free(client->message_sizes);
+		client->message_sizes = i_new(uoff_t, client->messages_count);
+
 		t = mailbox_transaction_begin(client->mailbox, FALSE);
 		ctx = mailbox_search_init(t, NULL, &search_arg, NULL,
 					  MAIL_FETCH_SIZE, NULL);



More information about the dovecot-cvs mailing list