From: Timo Sirainen Date: Wed, 1 Jun 2016 21:52:37 +0000 (+0300) Subject: dict: Pipelined iteration replies may have been hanging. X-Git-Tag: 2.3.0.rc1~3589 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bb454924c8b4612e4b657e60a860f8f0f3d6054;p=thirdparty%2Fdovecot%2Fcore.git dict: Pipelined iteration replies may have been hanging. For example: - lookup start - iterate start - iterate finished, but can't reply yet - lookup finished - iterate reply can be sent now, but wasn't previously --- diff --git a/src/dict/dict-commands.c b/src/dict/dict-commands.c index 8f13113e52..44ec866055 100644 --- a/src/dict/dict-commands.c +++ b/src/dict/dict-commands.c @@ -34,6 +34,8 @@ struct dict_connection_cmd { struct dict_command_stats cmd_stats; +static int cmd_iterate_flush(struct dict_connection_cmd *cmd); + static void dict_connection_cmd_output_more(struct dict_connection_cmd *cmd); static void dict_connection_cmd_free(struct dict_connection_cmd *cmd) @@ -76,6 +78,10 @@ static void dict_connection_cmds_flush(struct dict_connection *conn) first_cmdp = array_idx(&conn->cmds, 0); cmd = *first_cmdp; + /* we may be able to start outputting iterations now. */ + if (cmd->iter != NULL) + (void)cmd_iterate_flush(cmd); + if (cmd->reply == NULL) { /* command not finished yet */ break;