]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: client: Uncork and flush the output stream explicitly after sending commands.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 17 Feb 2018 09:26:30 +0000 (10:26 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Mar 2018 08:42:26 +0000 (10:42 +0200)
This allows detecting any output stream errors.

src/lib-smtp/smtp-client-connection.c

index 32e83dd9056e670a6028fcde4a849b08c9614c2f..a361794bde46798984061329cc422918bee54fbf 100644 (file)
@@ -1106,8 +1106,13 @@ static int smtp_client_connection_output(struct smtp_client_connection *conn)
        }
 
        smtp_client_connection_ref(conn);
+       o_stream_cork(conn->conn.output);
        if (smtp_client_command_send_more(conn) < 0)
                ret = -1;
+       if (ret >= 0 && conn->conn.output != NULL && !conn->corked) {
+               if (o_stream_uncork_flush(conn->conn.output) < 0)
+                       smtp_client_connection_handle_output_error(conn);
+       }
        smtp_client_connection_unref(&conn);
        return ret;
 }