From: Timo Sirainen Date: Mon, 16 Apr 2018 13:28:24 +0000 (+0300) Subject: global: Replace ssl_iostream_unref() with ssl_iostream_destroy() X-Git-Tag: 2.3.2.rc1~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ea1304a2d532f5d9b43ae0b47eefb20a4e905b1;p=thirdparty%2Fdovecot%2Fcore.git global: Replace ssl_iostream_unref() with ssl_iostream_destroy() Destroying performs cleanups correctly. --- diff --git a/src/doveadm/server-connection.c b/src/doveadm/server-connection.c index 269985d629..e5b9930f53 100644 --- a/src/doveadm/server-connection.c +++ b/src/doveadm/server-connection.c @@ -603,8 +603,7 @@ void server_connection_destroy(struct server_connection **_conn) i_stream_destroy(&conn->cmd_input); /* close cmd_output after its parent, so the "." isn't sent */ o_stream_destroy(&conn->cmd_output); - if (conn->ssl_iostream != NULL) - ssl_iostream_unref(&conn->ssl_iostream); + ssl_iostream_destroy(&conn->ssl_iostream); io_remove(&conn->io_log); /* make sure all logs got consumed */ if (conn->log_input != NULL) diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index 722c91fbf6..a694bbc40a 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -1797,8 +1797,7 @@ bool http_client_connection_unref(struct http_client_connection **_conn) if (array_is_created(&conn->request_wait_list)) array_free(&conn->request_wait_list); - if (conn->ssl_iostream != NULL) - ssl_iostream_unref(&conn->ssl_iostream); + ssl_iostream_destroy(&conn->ssl_iostream); if (conn->connect_initialized) connection_deinit(&conn->conn); io_wait_timer_remove(&conn->io_wait_timer); diff --git a/src/lib-http/http-server-connection.c b/src/lib-http/http-server-connection.c index c84ca70989..f59d4bc872 100644 --- a/src/lib-http/http-server-connection.c +++ b/src/lib-http/http-server-connection.c @@ -1172,8 +1172,7 @@ bool http_server_connection_unref(struct http_server_connection **_conn) http_server_connection_debug(conn, "Connection destroy"); - if (conn->ssl_iostream != NULL) - ssl_iostream_unref(&conn->ssl_iostream); + ssl_iostream_destroy(&conn->ssl_iostream); connection_deinit(&conn->conn); if (conn->callbacks != NULL && diff --git a/src/lib-imap-client/imapc-connection.c b/src/lib-imap-client/imapc-connection.c index 264a05a0cc..c9e2b97f86 100644 --- a/src/lib-imap-client/imapc-connection.c +++ b/src/lib-imap-client/imapc-connection.c @@ -461,8 +461,7 @@ void imapc_connection_disconnect_full(struct imapc_connection *conn, if (conn->parser != NULL) imap_parser_unref(&conn->parser); io_remove(&conn->io); - if (conn->ssl_iostream != NULL) - ssl_iostream_unref(&conn->ssl_iostream); + ssl_iostream_destroy(&conn->ssl_iostream); if (conn->fd != -1) { i_stream_destroy(&conn->input); o_stream_destroy(&conn->output); diff --git a/src/lib-smtp/smtp-client-connection.c b/src/lib-smtp/smtp-client-connection.c index 811dde546b..c5ceabe8ce 100644 --- a/src/lib-smtp/smtp-client-connection.c +++ b/src/lib-smtp/smtp-client-connection.c @@ -1592,8 +1592,7 @@ void smtp_client_connection_disconnect(struct smtp_client_connection *conn) timeout_remove(&conn->to_trans); timeout_remove(&conn->to_commands); - if (conn->ssl_iostream != NULL) - ssl_iostream_unref(&conn->ssl_iostream); + ssl_iostream_destroy(&conn->ssl_iostream); if (conn->ssl_ctx != NULL) ssl_iostream_context_unref(&conn->ssl_ctx); if (conn->sasl_client != NULL) diff --git a/src/lib-storage/index/pop3c/pop3c-client.c b/src/lib-storage/index/pop3c/pop3c-client.c index e34efc3af0..ed5baa1e76 100644 --- a/src/lib-storage/index/pop3c/pop3c-client.c +++ b/src/lib-storage/index/pop3c/pop3c-client.c @@ -204,8 +204,7 @@ static void pop3c_client_disconnect(struct pop3c_client *client) io_remove(&client->io); i_stream_destroy(&client->input); o_stream_destroy(&client->output); - if (client->ssl_iostream != NULL) - ssl_iostream_unref(&client->ssl_iostream); + ssl_iostream_destroy(&client->ssl_iostream); i_close_fd(&client->fd); while (array_count(&client->commands) > 0) pop3c_client_async_callback_disconnected(client);