]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Include number of users sent in handshake in disconnection log lines
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 26 Nov 2017 10:13:35 +0000 (12:13 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 26 Nov 2017 11:07:34 +0000 (13:07 +0200)
src/director/director-connection.c

index 965f726fadb2ec395c08d794ef975093481c7731..4283dee273cf2154436ec12e8361a75e33b1f0c4 100644 (file)
@@ -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 */