[dovecot-cvs] dovecot/src/imap cmd-append.c,1.54,1.55

cras at dovecot.org cras at dovecot.org
Sat Feb 12 11:36:25 EET 2005


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv31894

Modified Files:
	cmd-append.c 
Log Message:
Don't crash if client disconnects in the middle of APPEND. The last fix
was incorrect.



Index: cmd-append.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- cmd-append.c	5 Feb 2005 18:07:26 -0000	1.54
+++ cmd-append.c	12 Feb 2005 09:36:23 -0000	1.55
@@ -306,9 +306,8 @@
 		i_stream_skip(ctx->input, size);
 	}
 
-	if (ctx->input->v_offset == ctx->msg_size || ctx->input->closed) {
+	if (ctx->input->v_offset == ctx->msg_size || client->input->closed) {
 		/* finished */
-		failed = ctx->input->closed;
 		i_stream_unref(ctx->input);
 		ctx->input = NULL;
 
@@ -323,6 +322,8 @@
 		} else if (mailbox_save_finish(ctx->save_ctx, NULL) < 0) {
 			failed = TRUE;
 			client_send_storage_error(cmd, ctx->storage);
+		} else {
+			failed = client->input->closed;
 		}
 		ctx->save_ctx = NULL;
 



More information about the dovecot-cvs mailing list