From: Stephan Bosch Date: Sat, 17 Feb 2018 09:26:30 +0000 (+0100) Subject: lib-smtp: client: Uncork and flush the output stream explicitly after sending commands. X-Git-Tag: 2.3.9~2274 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce19176ce2fcb6db22d2d2f650d16fcc3e53a868;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: client: Uncork and flush the output stream explicitly after sending commands. This allows detecting any output stream errors. --- diff --git a/src/lib-smtp/smtp-client-connection.c b/src/lib-smtp/smtp-client-connection.c index 33e3919cfd..8de8ffc4db 100644 --- a/src/lib-smtp/smtp-client-connection.c +++ b/src/lib-smtp/smtp-client-connection.c @@ -1080,8 +1080,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; }