From: Timo Sirainen Date: Fri, 27 Oct 2017 21:48:01 +0000 (+0300) Subject: lib-imap: When sending "+ OK" to client, uncork ostream immediately X-Git-Tag: 2.3.0.rc1~712 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=414bbc6dfb81276908f130354890b143cbf1203c;p=thirdparty%2Fdovecot%2Fcore.git lib-imap: When sending "+ OK" to client, uncork ostream immediately This makes sure that it's sent to the client as soon as possible. Also removed o_stream_nflush(), since uncorking does that already. If there is no corking, the "+ OK" was already attempted to be sent by the o_stream_nsend() call and a flush is unlikely to help. --- diff --git a/src/lib-imap/imap-parser.c b/src/lib-imap/imap-parser.c index 2b75a40017..a682b6b47d 100644 --- a/src/lib-imap/imap-parser.c +++ b/src/lib-imap/imap-parser.c @@ -414,7 +414,12 @@ static bool imap_parser_literal_end(struct imap_parser *parser) if (parser->output != NULL && !parser->literal_nonsync) { o_stream_nsend(parser->output, "+ OK\r\n", 6); - o_stream_nflush(parser->output); + if (o_stream_is_corked(parser->output)) { + /* make sure this continuation is sent to the + client as soon as possible */ + o_stream_uncork(parser->output); + o_stream_cork(parser->output); + } } }