From: Timo Sirainen Date: Fri, 1 Oct 2010 17:33:58 +0000 (+0100) Subject: imap: Don't reset input/output byte counters when COMPRESS is started. X-Git-Tag: 2.0.5~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea06c6e6879161f8b9cdbe19689afceac4c7651d;p=thirdparty%2Fdovecot%2Fcore.git imap: Don't reset input/output byte counters when COMPRESS is started. --- diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index dee92bf854..f4b88ce09f 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -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); diff --git a/src/plugins/imap-zlib/imap-zlib-plugin.c b/src/plugins/imap-zlib/imap-zlib-plugin.c index 502d8a563e..74b0925379 100644 --- a/src/plugins/imap-zlib/imap-zlib-plugin.c +++ b/src/plugins/imap-zlib/imap-zlib-plugin.c @@ -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);