Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8812:69a5c4798421 HEAD
imap: Improve "FETCH .. got too little data" error messages.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 11 Mar 2009 16:04:01 -0400 |
parents | 69ddd7c9c585 |
children | 6431b25959c4 |
files | src/imap/imap-fetch-body.c src/imap/imap-fetch.h |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/imap-fetch-body.c Tue Mar 10 12:28:22 2009 -0400 +++ b/src/imap/imap-fetch-body.c Wed Mar 11 16:04:01 2009 -0400 @@ -207,8 +207,8 @@ and if it was just a temporary error the message would be permanently left corrupted in client's local cache. So, we disconnect the client and hope that next try works. */ - i_error("FETCH for mailbox %s UID %u got too little data: " - "%"PRIuUOFF_T" vs %"PRIuUOFF_T, + i_error("FETCH %s for mailbox %s UID %u got too little data: " + "%"PRIuUOFF_T" vs %"PRIuUOFF_T, ctx->cur_name, mailbox_get_name(ctx->mail->box), ctx->mail->uid, (uoff_t)sent, virtual_size); mail_set_cache_corrupted(ctx->mail, ctx->cur_size_field); @@ -269,10 +269,10 @@ /* 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: " + i_error("FETCH %s for mailbox %s UID %u " + "got too little data (copying): " "%"PRIuUOFF_T" vs %"PRIuUOFF_T, - mailbox_get_name(ctx->mail->box), + ctx->cur_name, mailbox_get_name(ctx->mail->box), ctx->mail->uid, ctx->cur_offset, ctx->cur_size); o_stream_close(ctx->client->output); return -1; @@ -310,6 +310,8 @@ { string_t *str; + ctx->cur_name = p_strconcat(ctx->cmd->pool, + "[", body->section, "]", NULL); ctx->cur_size = get_send_size(body, size->virtual_size); str = get_prefix(ctx, body, ctx->cur_size); @@ -922,6 +924,7 @@ return -1; } + ctx->cur_name = "RFC822"; ctx->cur_size = size.virtual_size; ctx->cur_size_field = MAIL_FETCH_VIRTUAL_SIZE; return fetch_stream(ctx, &size); @@ -947,6 +950,7 @@ if (o_stream_send_str(ctx->client->output, str) < 0) return -1; + ctx->cur_name = "RFC822.HEADER"; ctx->cur_size = hdr_size.virtual_size; ctx->cur_size_field = MAIL_FETCH_MESSAGE_PARTS; return fetch_stream(ctx, &hdr_size); @@ -973,6 +977,7 @@ return -1; i_stream_seek(ctx->cur_input, hdr_size.physical_size); + ctx->cur_name = "RFC822.TEXT"; ctx->cur_size = body_size.virtual_size; ctx->cur_size_field = MAIL_FETCH_VIRTUAL_SIZE; return fetch_stream(ctx, &body_size);