]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-urlauth: imap-urlauth-worker - Use connection API's client-to-server VERSION...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 21 Feb 2023 00:33:15 +0000 (01:33 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 24 Mar 2023 07:14:54 +0000 (07:14 +0000)
Requires reordering sending FDs with VERSION line.

src/imap-urlauth/imap-urlauth-worker-client.c
src/imap-urlauth/imap-urlauth-worker.c

index c68ccedb3ed77896eae8e8a61e7943c3aa342ccd..2edf89722250dd29b4809e8dfdc9840f30b89d5e 100644 (file)
@@ -57,7 +57,6 @@ static const struct connection_settings client_worker_connection_set = {
        .unix_client_connect_msecs = 1000,
        .input_max_size = SIZE_MAX,
        .output_max_size = SIZE_MAX,
-       .dont_send_version = TRUE,
        .client = TRUE,
 };
 
@@ -152,18 +151,6 @@ imap_urlauth_worker_client_connected(struct connection *_conn, bool success)
                imap_urlauth_worker_client_disconnect(wclient);
                return;
        }
-
-       /* send protocol version handshake */
-       const char *handshake = t_strdup_printf(
-               "VERSION\timap-urlauth-worker\t%u\t%u\n",
-               IMAP_URLAUTH_WORKER_PROTOCOL_MAJOR_VERSION,
-               IMAP_URLAUTH_WORKER_PROTOCOL_MINOR_VERSION);
-       if (o_stream_send_str(wclient->conn.output, handshake) < 0) {
-               e_error(wclient->event,
-                       "Error sending handshake to imap-urlauth worker: %m");
-               imap_urlauth_worker_client_disconnect(wclient);
-               return;
-       }
 }
 
 int imap_urlauth_worker_client_connect(
index a113ea0efdbefe1d6a733ba4721f183e3a5716c3..dd469a5b2122ba368986a31b4ec0442819f885f6 100644 (file)
@@ -765,14 +765,6 @@ static void client_ctrl_input(struct connection *_conn)
 
        timeout_reset(client->to_idle);
 
-       if (client->conn.fd_in == -1 || client->conn.fd_out == -1) {
-               if ((ret = client_ctrl_read_fds(client)) <= 0) {
-                       if (ret < 0)
-                               client_abort(client, "FD Transfer failed");
-                       return;
-               }
-       }
-
        if (connection_input_read(&client->conn_ctrl) < 0)
                return;
 
@@ -791,6 +783,14 @@ static void client_ctrl_input(struct connection *_conn)
                }
 
                client->version_received = TRUE;
+       }
+
+       if (client->conn.fd_in == -1 || client->conn.fd_out == -1) {
+               if ((ret = client_ctrl_read_fds(client)) <= 0) {
+                       if (ret < 0)
+                               client_abort(client, "FD Transfer failed");
+                       return;
+               }
                if (o_stream_send_str(client->conn_ctrl.output, "OK\n") < 0) {
                        client_destroy(client);
                        return;