[dovecot-cvs] dovecot/src/imap imap-fetch-body.c,1.31,1.32
tss at dovecot.org
tss at dovecot.org
Sun Mar 11 01:47:07 EET 2007
Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv7015
Modified Files:
imap-fetch-body.c
Log Message:
If mail was in CR+LF format in the disk and we used sendfile() call, but the
call couldn't send everything, we hanged.
Index: imap-fetch-body.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch-body.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- imap-fetch-body.c 25 Jan 2007 15:59:26 -0000 1.31
+++ imap-fetch-body.c 10 Mar 2007 23:47:05 -0000 1.32
@@ -253,18 +253,23 @@
ctx->cur_append_eoh = FALSE;
}
- if (ctx->cur_offset != ctx->cur_size &&
- !i_stream_have_bytes_left(ctx->cur_input)) {
- /* Input stream gave less data than expected */
- i_error("FETCH for mailbox %s UID %u got too little data: "
- "%"PRIuUOFF_T" vs %"PRIuUOFF_T,
- mailbox_get_name(ctx->mail->box), ctx->mail->uid,
- ctx->cur_offset, ctx->cur_size);
- o_stream_close(ctx->client->output);
- return -1;
- }
+ if (ctx->cur_offset != ctx->cur_size) {
+ /* unfinished */
+ if (!i_stream_have_bytes_left(ctx->cur_input)) {
+ /* Input stream gave less data than expected */
+ i_error("FETCH for mailbox %s UID %u "
+ "got too little data: "
+ "%"PRIuUOFF_T" vs %"PRIuUOFF_T,
+ mailbox_get_name(ctx->mail->box),
+ ctx->mail->uid, ctx->cur_offset, ctx->cur_size);
+ o_stream_close(ctx->client->output);
+ return -1;
+ }
- return ctx->cur_offset == ctx->cur_size;
+ o_stream_set_flush_pending(ctx->client->output, TRUE);
+ return 0;
+ }
+ return 1;
}
static int fetch_stream(struct imap_fetch_context *ctx,
More information about the dovecot-cvs
mailing list