[dovecot-cvs] dovecot/src/imap cmd-append.c,1.80.2.1,1.80.2.2
tss at dovecot.org
tss at dovecot.org
Tue Feb 6 12:55:00 UTC 2007
Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv23739
Modified Files:
Tag: branch_1_0
cmd-append.c
Log Message:
If client disconnects at the end of append without waiting for a reply,
handle it properly.
Index: cmd-append.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.80.2.1
retrieving revision 1.80.2.2
diff -u -d -r1.80.2.1 -r1.80.2.2
--- cmd-append.c 18 May 2006 09:50:25 -0000 1.80.2.1
+++ cmd-append.c 6 Feb 2007 12:54:57 -0000 1.80.2.2
@@ -305,12 +305,18 @@
struct cmd_append_context *ctx = cmd->context;
size_t size;
bool failed;
+ int ret;
if (ctx->save_ctx != NULL) {
- if (mailbox_save_continue(ctx->save_ctx) < 0) {
- /* we still have to finish reading the message
- from client */
- mailbox_save_cancel(&ctx->save_ctx);
+ while (ctx->input->v_offset != ctx->msg_size) {
+ ret = i_stream_read(ctx->input);
+ if (mailbox_save_continue(ctx->save_ctx) < 0) {
+ /* we still have to finish reading the message
+ from client */
+ mailbox_save_cancel(&ctx->save_ctx);
+ }
+ if (ret == -1)
+ break;
}
}
More information about the dovecot-cvs
mailing list