aboutsummaryrefslogtreecommitdiff
path: root/multi.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--multi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/multi.c b/multi.c
index 733a8b0..6704789 100644
--- a/multi.c
+++ b/multi.c
@@ -503,6 +503,10 @@ multi_close_instance (struct multi_context *m,
dmsg (D_MULTI_DEBUG, "MULTI: multi_close_instance called");
+ /* adjust current client connection count */
+ m->n_clients += mi->n_clients_delta;
+ mi->n_clients_delta = 0;
+
/* prevent dangling pointers */
if (m->pending == mi)
multi_set_pending (m, NULL);
@@ -1688,6 +1692,10 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi
/* set flag so we don't get called again */
mi->connection_established_flag = true;
+ /* increment number of current authenticated clients */
+ ++m->n_clients;
+ --mi->n_clients_delta;
+
#ifdef MANAGEMENT_DEF_AUTH
if (management)
management_connection_established (management, &mi->context.c2.mda_context);
@@ -2437,6 +2445,13 @@ management_callback_status (void *arg, const int version, struct status_output *
}
static int
+management_callback_n_clients (void *arg)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ return m->n_clients;
+}
+
+static int
management_callback_kill_by_cn (void *arg, const char *del_cn)
{
struct multi_context *m = (struct multi_context *) arg;
@@ -2598,6 +2613,7 @@ init_management_callback_multi (struct multi_context *m)
cb.kill_by_cn = management_callback_kill_by_cn;
cb.kill_by_addr = management_callback_kill_by_addr;
cb.delete_event = management_delete_event;
+ cb.n_clients = management_callback_n_clients;
#ifdef MANAGEMENT_DEF_AUTH
cb.kill_by_cid = management_kill_by_cid;
cb.client_auth = management_client_auth;