]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-login: Remove extra '+' from state strings in log output
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 18 Sep 2018 22:28:13 +0000 (01:28 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 20 Sep 2018 10:08:41 +0000 (10:08 +0000)
If multiple outgoing commands were in progress, the state should have
said e.g. "state=capability+login", not "state=capability+++login".

src/imap-login/imap-proxy.c

index 879ee68103023ecbadf9b2cba44ca6336ee3e8f8..3aed94dd0927c03f5101e879b2686764c382e1e4 100644 (file)
@@ -465,10 +465,11 @@ const char *imap_proxy_get_state(struct client *client)
        string_t *str = t_str_new(128);
 
        for (unsigned int i = 0; i < IMAP_PROXY_SENT_STATE_COUNT; i++) {
-               if (str_len(str) > 0)
-                       str_append_c(str, '+');
-               if ((imap_client->proxy_sent_state & (1 << i)) != 0)
+               if ((imap_client->proxy_sent_state & (1 << i)) != 0) {
+                       if (str_len(str) > 0)
+                               str_append_c(str, '+');
                        str_append(str, imap_proxy_sent_state_names[i]);
+               }
        }
        str_append_c(str, '/');
        str_append(str, imap_proxy_rcvd_state_names[imap_client->proxy_rcvd_state]);