From: Timo Sirainen Date: Sun, 26 Nov 2017 10:13:35 +0000 (+0200) Subject: director: Include number of users sent in handshake in disconnection log lines X-Git-Tag: 2.2.34~210 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d3dc75c297cb8873e4e827aaff5d205da0e3d7f;p=thirdparty%2Fdovecot%2Fcore.git director: Include number of users sent in handshake in disconnection log lines --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 965f726fad..4283dee273 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -134,6 +134,7 @@ struct director_connection { struct director_user_iter *user_iter; unsigned int users_received, handshake_users_received; + unsigned int handshake_users_sent; /* set during command execution */ const char *cur_cmd, *const *cur_args; @@ -191,6 +192,10 @@ director_connection_append_stats(struct director_connection *conn, string_t *str conn->input->v_offset, conn->output->offset); str_printfa(str, ", %u+%u USERs received", conn->handshake_users_received, conn->users_received); + if (conn->handshake_users_sent > 0) { + str_printfa(str, ", %u USERs sent in handshake", + conn->handshake_users_sent); + } if (conn->last_input.tv_sec > 0) { str_printfa(str, ", last input %u.%03u s ago", input_msecs/1000, input_msecs%1000); @@ -2117,6 +2122,8 @@ static int director_connection_send_users(struct director_connection *conn) if (user->weak) str_append(str, "\tw"); str_append_c(str, '\n'); + + conn->handshake_users_sent++; director_connection_send(conn, str_c(str)); if (++sent_count >= DIRECTOR_HANDSHAKE_MAX_USERS_SENT_PER_FLUSH) { /* Don't send too much at once to avoid hangs */