[dovecot-cvs] dovecot/src/imap cmd-append.c, 1.37, 1.38 cmd-copy.c,
1.20, 1.21
cras at procontrol.fi
cras at procontrol.fi
Mon Jun 21 17:51:06 EEST 2004
Update of /home/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv16642/src/imap
Modified Files:
cmd-append.c cmd-copy.c
Log Message:
Removed UIDPLUS after all, it needs more thinking about with maildir.
Index: cmd-append.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cmd-append.c 20 Jun 2004 06:33:08 -0000 1.37
+++ cmd-append.c 21 Jun 2004 14:51:04 -0000 1.38
@@ -56,12 +56,9 @@
struct mailbox_keywords old_flags;
struct mail_full_flags flags;
struct istream *input;
- struct mail *mail;
time_t internal_date;
const char *mailbox, *internal_date_str;
uoff_t msg_size;
- string_t *reply;
- struct msgset_generator_context msgset_ctx;
unsigned int count;
int ret, failed, timezone_offset, nonsync;
@@ -88,8 +85,7 @@
}
}
- if (mailbox_get_status(box, STATUS_KEYWORDS | STATUS_UIDVALIDITY,
- &status) < 0) {
+ if (mailbox_get_status(box, STATUS_KEYWORDS, &status) < 0) {
client_send_storage_error(client, storage);
mailbox_close(box);
return TRUE;
@@ -104,10 +100,6 @@
/* if error occurs, the CRLF is already read. */
client->input_skip_line = FALSE;
- reply = str_new(default_pool, 256);
- str_printfa(reply, "OK [APPENDUID %u ", status.uidvalidity);
-
- msgset_generator_init(&msgset_ctx, reply);
count = 0;
failed = TRUE;
save_parser = imap_parser_create(client->input, client->output,
@@ -195,15 +187,13 @@
client->input->v_offset,
msg_size);
if (mailbox_save(t, &flags, internal_date, timezone_offset,
- NULL, input, &mail) < 0) {
+ NULL, input, NULL) < 0) {
i_stream_unref(input);
client_send_storage_error(client, storage);
break;
}
i_stream_unref(input);
- msgset_generator_next(&msgset_ctx, mail->uid);
-
if (client->input->closed)
break;
@@ -211,8 +201,6 @@
}
imap_parser_destroy(save_parser);
- msgset_generator_finish(&msgset_ctx);
-
if (failed)
mailbox_transaction_rollback(t);
else {
@@ -227,10 +215,8 @@
if (!failed) {
client_sync_full(client);
- str_append(reply, "] Append completed.");
- client_send_tagline(client, str_c(reply));
+ client_send_tagline(client, "OK Append completed.");
}
- str_free(reply);
return TRUE;
}
Index: cmd-copy.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-copy.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmd-copy.c 20 Jun 2004 06:33:08 -0000 1.20
+++ cmd-copy.c 21 Jun 2004 14:51:04 -0000 1.21
@@ -7,13 +7,11 @@
static int fetch_and_copy(struct mailbox_transaction_context *t,
struct mailbox *srcbox,
- struct mail_search_arg *search_args,
- string_t *reply)
+ struct mail_search_arg *search_args)
{
struct mail_search_context *search_ctx;
struct mailbox_transaction_context *src_trans;
- struct mail *mail, *dest_mail;
- struct msgset_generator_context srcset_ctx, destset_ctx;
+ struct mail *mail;
string_t *dest_str;
int ret;
@@ -27,8 +25,6 @@
}
dest_str = t_str_new(128);
- msgset_generator_init(&srcset_ctx, reply);
- msgset_generator_init(&destset_ctx, dest_str);
ret = 1;
while ((mail = mailbox_search_next(search_ctx)) != NULL) {
@@ -36,25 +32,11 @@
ret = 0;
break;
}
- if (mailbox_copy(t, mail, &dest_mail) < 0) {
+ if (mailbox_copy(t, mail, NULL) < 0) {
ret = -1;
break;
}
- msgset_generator_next(&srcset_ctx, mail->uid);
- msgset_generator_next(&destset_ctx, dest_mail->uid);
-
- }
-
- msgset_generator_finish(&srcset_ctx);
- msgset_generator_finish(&destset_ctx);
-
- if (str_len(dest_str) == 0)
- str_truncate(reply, 0);
- else {
- str_append_c(reply, ' ');
- str_append_str(reply, dest_str);
- str_append(reply, "] Copy completed.");
}
if (mailbox_search_deinit(search_ctx) < 0)
@@ -72,9 +54,7 @@
struct mailbox *destbox;
struct mailbox_transaction_context *t;
struct mail_search_arg *search_arg;
- struct mailbox_status status;
const char *messageset, *mailbox;
- string_t *reply;
int ret;
/* <message set> <mailbox> */
@@ -110,18 +90,8 @@
}
}
- if (mailbox_get_status(destbox, STATUS_UIDVALIDITY, &status) < 0) {
- client_send_storage_error(client, storage);
- if (destbox != client->mailbox)
- mailbox_close(destbox);
- return TRUE;
- }
-
- reply = str_new(default_pool, 512);
- str_printfa(reply, "OK [COPYUID %u ", status.uidvalidity);
-
t = mailbox_transaction_begin(destbox, FALSE);
- ret = fetch_and_copy(t, client->mailbox, search_arg, reply);
+ ret = fetch_and_copy(t, client->mailbox, search_arg);
if (ret <= 0)
mailbox_transaction_rollback(t);
@@ -142,12 +112,7 @@
client_sync_full(client);
else
client_sync_full_fast(client);
- if (str_len(reply) > 0)
- client_send_tagline(client, str_c(reply));
- else {
- client_send_tagline(client,
- "OK Copy completed, no messages found.");
- }
+ client_send_tagline(client, "OK Copy completed.");
}
if (destbox != client->mailbox)
More information about the dovecot-cvs
mailing list