]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: relay backend: Turn client_proxy_destroy() into a relay backend vfunc.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 15 Sep 2018 12:25:38 +0000 (14:25 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:40:41 +0000 (15:40 +0200)
src/submission/submission-backend-relay.c
src/submission/submission-backend-relay.h
src/submission/submission-client.c

index 3572cb3416c3d9ad07d8445cb0a97df78356e93d..6a848e08b2c9dff1b7c21bf8113f76e0a436960e 100644 (file)
@@ -810,9 +810,10 @@ void client_proxy_create(struct client *client,
                set->submission_relay_port, ssl_mode, &smtp_set);
 }
 
-void client_proxy_destroy(struct client *client)
+static void backend_relay_destroy(struct submission_backend *_backend)
 {
-       struct submission_backend_relay *backend = &client->backend;
+       struct submission_backend_relay *backend =
+               (struct submission_backend_relay *)_backend;
 
        if (backend->conn != NULL)
                smtp_client_connection_close(&backend->conn);
@@ -876,6 +877,8 @@ uoff_t client_proxy_get_max_mail_size(struct client *client)
 }
 
 static struct submission_backend_vfuncs backend_relay_vfuncs = {
+       .destroy = backend_relay_destroy,
+
        .cmd_helo = backend_relay_cmd_helo,
 
        .cmd_mail = backend_relay_cmd_mail,
index bd2b53ddd0592837a815d4987b8e17361152119a..2f0f2d41a1c6b1c0cebf946f04cfb72609571949 100644 (file)
@@ -18,7 +18,6 @@ struct submission_backend_relay {
 
 void client_proxy_create(struct client *client,
                         const struct submission_settings *set);
-void client_proxy_destroy(struct client *client);
 void client_proxy_start(struct client *client);
 
 void client_proxy_input_pre(struct client *client);
index 3490656a9760ad84bbe3407b6fd38ae5b6667b43..0bf3353a0818a329374a99c9860211fdcd437465 100644 (file)
@@ -262,8 +262,6 @@ void client_destroy(struct client *client, const char *prefix,
        submission_client_count--;
        DLLIST_REMOVE(&submission_clients, client);
 
-       client_proxy_destroy(client);
-
        if (client->anvil_sent) {
                master_service_anvil_send(master_service, t_strconcat(
                        "DISCONNECT\t", my_pid, "\tsubmission/",
@@ -381,7 +379,6 @@ void client_disconnect(struct client *client, const char *enh_code,
        client->disconnected = TRUE;
 
        timeout_remove(&client->to_quit);
-       client_proxy_destroy(client);
        submission_backends_destroy_all(client);
 
        if (array_is_created(&client->rcpt_to)) {