]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 4/5] imap-login: Add dict_reset side-channel command to imap-proxy
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 16 Apr 2026 15:38:45 +0000 (17:38 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
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

src/imap-login/imap-proxy.c

index 03dad690e1ef1b57c2635aacc40e0bd6bd1cb083..2084cb290ddd5f64f48f14f9c3f4538e4bc3a206 100644 (file)
@@ -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;