]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-server: tcp: Moved client_connection_destroy().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 7 Oct 2017 14:57:45 +0000 (16:57 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 24 Oct 2017 20:29:19 +0000 (22:29 +0200)
src/doveadm/client-connection-tcp.c

index 6f719bdb4513f4d5df1ba90fc98d5be7c3f8d0ae..a36b71f740b50008dc54084ad9815f1cdb410f3f 100644 (file)
@@ -558,6 +558,39 @@ client_connection_send_auth_handshake(struct client_connection *
        }
 }
 
+void client_connection_destroy(struct client_connection **_conn)
+{
+       struct client_connection *conn = *_conn;
+
+       *_conn = NULL;
+
+       doveadm_print_deinit();
+
+       if (conn->http)
+               client_connection_destroy_http(conn);
+
+       if (conn->ssl_iostream != NULL)
+               ssl_iostream_destroy(&conn->ssl_iostream);
+
+       o_stream_destroy(&conn->output);
+
+       io_remove(&conn->io);
+
+       if (conn->log_out != NULL) {
+               doveadm_server_restore_logs();
+               o_stream_unref(&conn->log_out);
+       }
+
+       i_stream_destroy(&conn->input);
+
+       i_close_fd(&conn->fd);
+       pool_unref(&conn->pool);
+
+       doveadm_print_ostream = NULL;
+
+       client_connection_deinit(conn);
+}
+
 struct client_connection *
 client_connection_create(int fd, int listen_fd, bool ssl)
 {
@@ -593,36 +626,3 @@ client_connection_create(int fd, int listen_fd, bool ssl)
 
        return conn;
 }
-
-void client_connection_destroy(struct client_connection **_conn)
-{
-       struct client_connection *conn = *_conn;
-
-       *_conn = NULL;
-
-       doveadm_print_deinit();
-
-       if (conn->http)
-               client_connection_destroy_http(conn);
-
-       if (conn->ssl_iostream != NULL)
-               ssl_iostream_destroy(&conn->ssl_iostream);
-
-       o_stream_destroy(&conn->output);
-
-       io_remove(&conn->io);
-
-       if (conn->log_out != NULL) {
-               doveadm_server_restore_logs();
-               o_stream_unref(&conn->log_out);
-       }
-
-       i_stream_destroy(&conn->input);
-
-       i_close_fd(&conn->fd);
-       pool_unref(&conn->pool);
-
-       doveadm_print_ostream = NULL;
-
-       client_connection_deinit(conn);
-}