From: Timo Sirainen Date: Thu, 16 Apr 2026 15:38:45 +0000 (+0200) Subject: [PATCH 4/5] imap-login: Add dict_reset side-channel command to imap-proxy X-Git-Tag: archive/raspbian/1%2.4.1+dfsg1-6+rpi1+deb13u7^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=73081009b2ff1e6015d43210f4ca83abdc70e995;p=dovecot.git [PATCH 4/5] imap-login: Add dict_reset side-channel command to imap-proxy When imap_compress_on_proxy is enabled, DEFLATE compression runs inside the imap-login process. The imap backend process cannot call o_stream_deflate_reset_dict() directly on a remote stream, so this adds a new side-channel command "dict_reset" that the backend can send to trigger the dictionary reset on the proxy side. Gbp-Pq: Name 0004-imap-login-Add-dict_reset-side-channel-command-to-im.patch --- diff --git a/src/imap-login/imap-proxy.c b/src/imap-login/imap-proxy.c index 03dad69..2084cb2 100644 --- a/src/imap-login/imap-proxy.c +++ b/src/imap-login/imap-proxy.c @@ -10,6 +10,7 @@ #include "str-sanitize.h" #include "safe-memset.h" #include "compression.h" +#include "ostream-zlib.h" #include "dsasl-client.h" #include "imap-login-client.h" #include "client-authenticate.h" @@ -641,11 +642,24 @@ proxy_side_cmd_compress(struct client *client, const char *const *args, return 0; } +static int +proxy_side_cmd_dict_reset(struct client *client, + const char *const *args ATTR_UNUSED, + const char **error_r ATTR_UNUSED) +{ + struct ostream *client_output = + login_proxy_get_client_ostream(client->login_proxy); + o_stream_deflate_reset_dict(client_output); + return 0; +} + int imap_proxy_side_channel_input(struct client *client, const char *const *args, const char **error_r) { if (strcmp(args[0], "compress") == 0) return proxy_side_cmd_compress(client, args + 1, error_r); + else if (strcmp(args[0], "dict_reset") == 0) + return proxy_side_cmd_dict_reset(client, args + 1, error_r); else { *error_r = "Unsupported command"; return -1;