summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2023-07-24 20:41:42 +0100
committerLuke Bratch <luke@bratch.co.uk>2023-07-24 20:41:42 +0100
commit3737c7a9750d3035f76128a9c32a32a4226c3939 (patch)
treeabfda659822edaa337c4177da08fc92dd578a69b
parent4544c4b56eae07e9da7ed0b4b0329b2989494f0b (diff)
Include 437 (ERR_UNAVAILRESOURCE) as part of "nick in use" resolution upon connecting.
-rw-r--r--TODO2
-rw-r--r--message.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/TODO b/TODO
index c65634f..6c90f83 100644
--- a/TODO
+++ b/TODO
@@ -43,3 +43,5 @@ BLABOUNCER/stdin functions to add:
KICK not handled.
Crash when requesting 30 hour replay.
+
+"too many clients, disconnecting and skipping loop iteration!" has been seen in the real world, e.g. Wed Jul 12 16:44:57 2023
diff --git a/message.c b/message.c
index 7067776..3eb35bd 100644
--- a/message.c
+++ b/message.c
@@ -748,10 +748,12 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
return 1;
}
- // Server 432 (ERR_ERRONEUSNICKNAME) or 433 (ERR_NICKNAMEINUSE) received? See which nick we're on and try another.
- // (But only if we're not already registered with the real IRC server.)
- if ((strncmp(tokens[1], "432", strlen(tokens[1])) == 0 || strncmp(tokens[1], "433", strlen(tokens[1])) == 0) && !strlen(ircdstate->greeting004)) {
- debugprint(DEBUG_SOME, "Server 432 (ERR_ERRONEUSNICKNAME) or 433 (ERR_NICKNAMEINUSE) found and it is: %s with length %zd! Trying another nick...\n",
+ // Server 432 (ERR_ERRONEUSNICKNAME), 433 (ERR_NICKNAMEINUSE), or 437 (ERR_UNAVAILRESOURCE) received? See which nick we're on and try another.
+ // (But only if we're not already registered with the real IRC server. In particular 437 (ERR_UNAVAILRESOURCE) may be about a channel rather
+ // our nick, but if we're not registered yet then it's probably about our nick.)
+ if ((strncmp(tokens[1], "432", strlen(tokens[1])) == 0 || strncmp(tokens[1], "433", strlen(tokens[1])) == 0 || strncmp(tokens[1], "437", strlen(tokens[1])) == 0)
+ && !strlen(ircdstate->greeting004)) {
+ debugprint(DEBUG_SOME, "Server 432 (ERR_ERRONEUSNICKNAME), 433 (ERR_NICKNAMEINUSE), or 437 (ERR_UNAVAILRESOURCE) found and it is: %s with length %zd! Trying another nick...\n",
tokens[1], strlen(tokens[1]));
// Find the nick (its index in the nicks array) currently selected