]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Fix error message logged for errors occurring in data wrapper strea...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 4 Apr 2018 22:34:49 +0000 (00:34 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 28 May 2018 06:16:13 +0000 (09:16 +0300)
Used the connection stream rather than the data stream to obtain the error.
Obviously, there is no error on the low-level connection when there is a data
istream (e.g. message size) error.

src/lib-smtp/smtp-server-cmd-data.c

index 4c95fb28e609ae7be475ac72c7aef54f80c83547..674416609cffa286b798478df8592d553085d605 100644 (file)
@@ -174,7 +174,8 @@ static void cmd_data_input_error(struct smtp_server_cmd_ctx *cmd)
        struct smtp_server_connection *conn = cmd->conn;
        struct smtp_server_command *command = cmd->cmd;
        struct cmd_data_context *data_cmd = command->data;
-       unsigned int stream_errno = conn->state.data_input->stream_errno;
+       struct istream *data_input = conn->state.data_input;
+       unsigned int stream_errno = data_input->stream_errno;
 
        conn->state.data_failed = TRUE;
 
@@ -190,8 +191,8 @@ static void cmd_data_input_error(struct smtp_server_cmd_ctx *cmd)
                smtp_server_connection_error(conn,
                        "Connection lost during data transfer: "
                        "read(%s) failed: %s",
-                       i_stream_get_name(conn->conn.input),
-                       i_stream_get_error(conn->conn.input));
+                       i_stream_get_name(data_input),
+                       i_stream_get_error(data_input));
                smtp_server_connection_close(&conn, "Read failure");
        } else {
                smtp_server_connection_debug(conn,