changeset 20247:7a06e0c5a1fc

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
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 02 Jun 2016 00:52:37 +0300
parents 4da2242652f3
children e0c290c2166c
files src/dict/dict-commands.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dict/dict-commands.c	Thu Jun 02 00:51:26 2016 +0300
+++ b/src/dict/dict-commands.c	Thu Jun 02 00:52:37 2016 +0300
@@ -34,6 +34,8 @@
 
 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)
@@ -72,6 +74,10 @@
 		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;