Skip to content

Commit

Permalink
lib-smtp: client: Uncork and flush the output stream explicitly after…
Browse files Browse the repository at this point in the history
… sending commands.

This allows detecting any output stream errors.
  • Loading branch information
stephanbosch committed Feb 17, 2018
1 parent 52cb7a9 commit ce19176
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib-smtp/smtp-client-connection.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit ce19176

Please sign in to comment.