]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict: Make sure connection IO is stopped when client is disconnected
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 10 May 2019 14:45:14 +0000 (17:45 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 13 May 2019 08:57:00 +0000 (08:57 +0000)
I'm not sure if this fixes anything, but it makes the behavior closer to
what it was before 2ff2da52146609f4459bd0f7fd603e13400cb85e.

src/dict/dict-commands.c
src/dict/dict-connection.c

index 799ada1cfa13d24bc13edb2e9bbc4daaeca30a7e..22f72a2176cc017579cf69921012fbc7dbc820bc 100644 (file)
@@ -51,7 +51,7 @@ static void dict_connection_cmd_free(struct dict_connection_cmd *cmd)
        }
        i_free(cmd->reply);
 
-       if (dict_connection_unref(cmd->conn))
+       if (dict_connection_unref(cmd->conn) && !cmd->conn->destroyed)
                connection_input_resume(&cmd->conn->conn);
        i_free(cmd);
 }
index 0ed046f6f427849cc3a9485e952fc1c9a266ba23..d8bab23c7711f2fc3c4e87e2fb78c768e1c5871d 100644 (file)
@@ -231,7 +231,10 @@ static void dict_connection_destroy(struct connection *_conn)
 
           flush the command output here in case we were waiting on iteration
           output. */
+       i_stream_close(conn->conn.input);
+       o_stream_close(conn->conn.output);
        dict_connection_cmds_output_more(conn);
+
        dict_connection_unref_safe(conn);
 }