]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Don't reset input/output byte counters when COMPRESS is started.
authorTimo Sirainen <tss@iki.fi>
Fri, 1 Oct 2010 17:33:58 +0000 (18:33 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 1 Oct 2010 17:33:58 +0000 (18:33 +0100)
src/imap/imap-client.c
src/plugins/imap-zlib/imap-zlib-plugin.c

index dee92bf85426ac6b810c0add33617a4c2403b21c..f4b88ce09f990f4bc18a98cfea9a0fadb61de65d 100644 (file)
@@ -145,7 +145,7 @@ static const char *client_stats(struct client *client)
        tab = t_malloc(sizeof(static_tab));
        memcpy(tab, static_tab, sizeof(static_tab));
 
-       tab[0].value = dec2str(client->input->v_offset);
+       tab[0].value = dec2str(i_stream_get_absolute_offset(client->input));
        tab[1].value = dec2str(client->output->offset);
 
        str = t_str_new(128);
index 502d8a563e0c87c1f603c837ae9df78fcbdc90ca..74b0925379d4dd058f50e058b5490047c6b43929 100644 (file)
@@ -112,6 +112,9 @@ static bool cmd_compress(struct client_command_context *cmd)
        old_output = client->output;
        client->input = handler->create_istream(old_input, FALSE);
        client->output = handler->create_ostream(old_output, level);
+       /* preserve output offset so that the bytes out counter in logout
+          message doesn't get reset here */
+       client->output->offset = old_output->offset;
        i_stream_unref(&old_input);
        o_stream_unref(&old_output);