From: Timo Sirainen Date: Fri, 27 Oct 2017 21:54:37 +0000 (+0300) Subject: imap: Make sure long COPY commands send "* OK Hang in there" packets X-Git-Tag: 2.3.0.rc1~711 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=401b336c846089939720908974de79c937d9e49f;p=thirdparty%2Fdovecot%2Fcore.git imap: Make sure long COPY commands send "* OK Hang in there" packets o_stream_nflush() already flushed the writes to kernel, and Linux should have sent them after 200ms delay, so this probably doesn't fix anything. Using uncork+cork is a bit clearer way to indicate that the data really is wanted to be sent now. --- diff --git a/src/imap/cmd-copy.c b/src/imap/cmd-copy.c index 708bf76448..15830e4de3 100644 --- a/src/imap/cmd-copy.c +++ b/src/imap/cmd-copy.c @@ -23,7 +23,9 @@ static void client_send_sendalive_if_needed(struct client *client) last_io = I_MAX(client->last_input, client->last_output); if (now - last_io > MAIL_STORAGE_STAYALIVE_SECS) { o_stream_nsend_str(client->output, "* OK Hang in there..\r\n"); - o_stream_nflush(client->output); + /* make sure it doesn't get stuck on the corked stream */ + o_stream_uncork(client->output); + o_stream_cork(client->output); client->last_output = now; } } @@ -45,6 +47,8 @@ static int fetch_and_copy(struct client_command_context *cmd, bool move, string_t *src_uidset; int ret; + i_assert(o_stream_is_corked(client->output)); + src_uidset = t_str_new(256); msgset_generator_init(&srcset_ctx, src_uidset);