Mercurial > dovecot > original-hg > dovecot-1.2
changeset 2640:66cad846df36 HEAD
cleanups
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 20 Sep 2004 02:23:08 +0300 |
parents | a307ddd22a3a |
children | e357ebb3137b |
files | src/imap/client.c src/imap/cmd-fetch.c src/imap/imap-fetch.c |
diffstat | 3 files changed, 15 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/client.c Sat Sep 18 17:37:18 2004 +0300 +++ b/src/imap/client.c Mon Sep 20 02:23:08 2004 +0300 @@ -378,9 +378,9 @@ static void client_output(void *context) { struct client *client = context; - int ret, finished; + int finished; - if ((ret = o_stream_flush(client->output)) < 0) { + if (o_stream_flush(client->output) < 0) { client_destroy(client); return; }
--- a/src/imap/cmd-fetch.c Sat Sep 18 17:37:18 2004 +0300 +++ b/src/imap/cmd-fetch.c Mon Sep 20 02:23:08 2004 +0300 @@ -85,7 +85,9 @@ client_send_storage_error(client, storage); } return TRUE; - } if ((client_workarounds & WORKAROUND_OE6_FETCH_NO_NEWMAIL) != 0) { + } + + if ((client_workarounds & WORKAROUND_OE6_FETCH_NO_NEWMAIL) != 0) { client_send_tagline(client, ok_message); return TRUE; } else { @@ -104,6 +106,9 @@ /* unfinished */ return FALSE; } + if (ret < 0) + ctx->failed = TRUE; + if (imap_fetch_deinit(ctx) < 0) ret = -1; return cmd_fetch_finish(client, ret < 0); @@ -151,6 +156,8 @@ client->cmd_context = ctx; return FALSE; } + if (ret < 0) + ctx->failed = TRUE; if (imap_fetch_deinit(ctx) < 0) ret = -1; return cmd_fetch_finish(client, ret < 0);
--- a/src/imap/imap-fetch.c Sat Sep 18 17:37:18 2004 +0300 +++ b/src/imap/imap-fetch.c Mon Sep 20 02:23:08 2004 +0300 @@ -164,11 +164,8 @@ int ret; if (ctx->cont_handler != NULL) { - if ((ret = ctx->cont_handler(ctx)) <= 0) { - if (ret < 0) - ctx->failed = TRUE; + if ((ret = ctx->cont_handler(ctx)) <= 0) return ret; - } ctx->cont_handler = NULL; ctx->cur_offset = 0; @@ -200,10 +197,8 @@ ctx->cur_mail->seq); if (o_stream_send(ctx->client->output, str_data(ctx->cur_str), - str_len(ctx->cur_str)) < 0) { - ctx->failed = TRUE; + str_len(ctx->cur_str)) < 0) return -1; - } str_truncate(ctx->cur_str, 0); str_append_c(ctx->cur_str, ' '); @@ -218,10 +213,7 @@ t_pop(); if (ret <= 0) { - if (ret < 0) - ctx->failed = TRUE; - else - i_assert(ctx->cont_handler != NULL); + i_assert(ret < 0 || ctx->cont_handler != NULL); return ret; } @@ -233,17 +225,13 @@ if (o_stream_send(ctx->client->output, str_data(ctx->cur_str) + ctx->first, str_len(ctx->cur_str) - 1 - - ctx->first) < 0) { - ctx->failed = TRUE; + ctx->first) < 0) return -1; - } str_truncate(ctx->cur_str, 0); } - if (o_stream_send(ctx->client->output, ")\r\n", 3) < 0) { - ctx->failed = TRUE; + if (o_stream_send(ctx->client->output, ")\r\n", 3) < 0) return -1; - } ctx->cur_mail = NULL; ctx->cur_handler = 0;