From 548c4a3a86a37cf74aac5ef91f84b9a762dc1023 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 11 May 2020 18:05:41 -0400 Subject: Add server send queueing with time interval This addresses pounce getting killed with "Excess flood" when it sends NAMES commands for too many channels when a client connects. These commands, as well as automatic AWAY commands, are by default throttled to 5 per second. Tested on freenode with 36 channels and 200ms interval. --- client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 25707a8..e260bc7 100644 --- a/client.c +++ b/client.c @@ -69,7 +69,7 @@ struct Client *clientAlloc(struct tls *tls) { void clientFree(struct Client *client) { if (!client->need) { if (!(client->caps & CapPassive) && !--active) { - serverFormat("AWAY :%s\r\n", clientAway); + serverEnqueue("AWAY :%s\r\n", clientAway); } } tls_close(client->tls); @@ -122,7 +122,7 @@ static void maybeSync(struct Client *client) { stateSync(client); if (client->setPos) ringSet(client->consumer, client->setPos); if (!(client->caps & CapPassive) && !active++) { - serverFormat("AWAY\r\n"); + serverEnqueue("AWAY\r\n"); } } } -- cgit 1.4.1