Commit d83f1507 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

When the client_list is shared between servers, the served count is too

parent f2f5e820
Pipeline #3565 passed with stage
in 6 minutes and 1 second
......@@ -550,9 +550,10 @@ int mqtt_client_on(struct mqtt* mqtt, BOOL on, int sock, client_t* client, BOOL
strListJoin(list, buf, sizeof(buf), "\n");
mqtt_client_count(mqtt, mqtt->shared_client_list ? TOPIC_HOST : TOPIC_SERVER, mqtt->client_list.count);
mqtt_served_count(mqtt, TOPIC_SERVER, mqtt->served);
return mqtt_pub_strval(mqtt, mqtt->shared_client_list ? TOPIC_HOST : TOPIC_SERVER, "client_list", buf);
enum topic_depth depth = mqtt->shared_client_list ? TOPIC_HOST : TOPIC_SERVER;
mqtt_client_count(mqtt, depth, mqtt->client_list.count);
mqtt_served_count(mqtt, depth, mqtt->served);
return mqtt_pub_strval(mqtt, depth, "client_list", buf);
int mqtt_served_count(struct mqtt* mqtt, enum topic_depth depth, ulong count)
......@@ -715,8 +715,6 @@ static void client_on(void* p, BOOL on, int sock, client_t* client, BOOL update)
listRemoveTaggedNode(&client_list, sock, /* free_data: */TRUE);
mqtt_client_on(&bbs_startup.mqtt, on, sock, client, update);
mqtt_client_count(&bbs_startup.mqtt, TOPIC_HOST, client_list.count);
mqtt_served_count(&bbs_startup.mqtt, TOPIC_HOST, served);
lputs(LOG_INFO,NULL); /* update displayed stats */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment