From: Timo Sirainen Date: Tue, 18 Sep 2018 22:28:13 +0000 (+0300) Subject: imap-login: Remove extra '+' from state strings in log output X-Git-Tag: 2.3.9~1393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8d03c3cab68328947a5afb47f48aef5b5a1e4ab;p=thirdparty%2Fdovecot%2Fcore.git imap-login: Remove extra '+' from state strings in log output If multiple outgoing commands were in progress, the state should have said e.g. "state=capability+login", not "state=capability+++login". --- diff --git a/src/imap-login/imap-proxy.c b/src/imap-login/imap-proxy.c index 879ee68103..3aed94dd09 100644 --- a/src/imap-login/imap-proxy.c +++ b/src/imap-login/imap-proxy.c @@ -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]);