]> jfr.im git - solanum.git/commitdiff
ircd: serv_connect: don't try to connect if that would exceed the class limit
authorSimon Arlott <sa.me.uk>
Sun, 23 Jul 2017 13:59:22 +0000 (14:59 +0100)
committerSimon Arlott <sa.me.uk>
Sun, 23 Jul 2017 14:40:00 +0000 (15:40 +0100)
ircd/s_serv.c

index e727bb4d17924d69b484b6b711ae7f6cb80061a8..a0d1b16c4c8a0939795a0c1331d92252b372221d 100644 (file)
@@ -1090,6 +1090,16 @@ serv_connect(struct server_conf *server_p, struct Client *by)
                return 0;
        }
 
+       if (CurrUsers(server_p->class) >= MaxUsers(server_p->class)) {
+               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                                    "No more connections allowed in class \"%s\" for server %s",
+                                    server_p->class->class_name, server_p->name);
+               if(by && IsPerson(by) && !MyClient(by))
+                       sendto_one_notice(by, ":No more connections allowed in class \"%s\" for server %s",
+                                    server_p->class->class_name, server_p->name);
+               return 0;
+       }
+
        /* create a socket for the server connection */
        if(GET_SS_FAMILY(&sa_connect) == AF_UNSPEC)
        {