From: Stephan Bosch Date: Tue, 14 Feb 2023 18:06:35 +0000 (+0100) Subject: imap-urlauth: imap-urlauth-worker-client - Use version definitions to compose handshake. X-Git-Tag: 2.4.0~2870 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fdf4576815974d0ff6ae3d7b93f7f013f4feec5;p=thirdparty%2Fdovecot%2Fcore.git imap-urlauth: imap-urlauth-worker-client - Use version definitions to compose handshake. --- diff --git a/src/imap-urlauth/imap-urlauth-worker-client.c b/src/imap-urlauth/imap-urlauth-worker-client.c index 33b937000f..4743bfe3a8 100644 --- a/src/imap-urlauth/imap-urlauth-worker-client.c +++ b/src/imap-urlauth/imap-urlauth-worker-client.c @@ -72,7 +72,6 @@ int imap_urlauth_worker_client_connect( struct imap_urlauth_worker_client *wclient) { struct client *client = wclient->client; - static const char handshake[] = "VERSION\timap-urlauth-worker\t2\t0\n"; const char *socket_path; ssize_t ret; unsigned char data; @@ -122,6 +121,10 @@ int imap_urlauth_worker_client_connect( wclient->ctrl_output = o_stream_create_fd(wclient->fd_ctrl, SIZE_MAX); /* 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->ctrl_output, handshake) < 0) { e_error(wclient->event, "Error sending handshake to imap-urlauth worker: %m");