Mercurial > dovecot > original-hg > dovecot-1.2
changeset 2875:90f2ac2d16df HEAD
Make sure fetching gets deinitialized properly if connection closes in the
middle of it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 11 Nov 2004 19:36:51 +0200 |
parents | 0f485075ba8f |
children | 78dc2381f3af |
files | src/imap/cmd-fetch.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/cmd-fetch.c Thu Nov 11 17:25:50 2004 +0200 +++ b/src/imap/cmd-fetch.c Thu Nov 11 19:36:51 2004 +0200 @@ -1,6 +1,7 @@ /* Copyright (C) 2002-2004 Timo Sirainen */ #include "common.h" +#include "ostream.h" #include "commands.h" #include "imap-fetch.h" #include "imap-search.h" @@ -109,9 +110,13 @@ struct imap_fetch_context *ctx = client->cmd_context; int ret; - if ((ret = imap_fetch(ctx)) == 0) { - /* unfinished */ - return FALSE; + if (client->output->closed) + ret = -1; + else { + if ((ret = imap_fetch(ctx)) == 0) { + /* unfinished */ + return FALSE; + } } if (ret < 0) ctx->failed = TRUE;