Skip to content

Commit

Permalink
lib-imap: When sending "+ OK" to client, uncork ostream immediately
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen authored and Timo Sirainen committed Oct 30, 2017
1 parent f81141f commit 414bbc6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib-imap/imap-parser.c
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 414bbc6

Please sign in to comment.