]> jfr.im git - solanum.git/blobdiff - src/listener.c
fixing maxconnections -> rb_get_maxconnections()
[solanum.git] / src / listener.c
index db14a35c6e9b0cf3cc22f08c8b254b72604de103..f41f43bc4fd5de4cedc487fcacf42a09d9e8cfd7 100644 (file)
@@ -1,51 +1,50 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  listener.c: Listens on a port.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002-2005 ircd-ratbox development team
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *  USA
- *
- *  $Id: listener.c 3460 2007-05-18 20:31:33Z jilles $
- */
-
-#include "stdinc.h"
-#include "setup.h"
-#include "listener.h"
-#include "client.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
-#include "ircd.h"
-#include "ircd_defs.h"
-#include "numeric.h"
-#include "s_conf.h"
-#include "s_newconf.h"
-#include "s_stats.h"
-#include "send.h"
-#include "s_auth.h"
-#include "reject.h"
-#include "s_conf.h"
-#include "hostmask.h"
-
+/*\r
+ *  ircd-ratbox: A slightly useful ircd.\r
+ *  listener.c: Listens on a port.\r
+ *\r
+ *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center\r
+ *  Copyright (C) 1996-2002 Hybrid Development Team\r
+ *  Copyright (C) 2002-2005 ircd-ratbox development team\r
+ *\r
+ *  This program is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  This program is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  You should have received a copy of the GNU General Public License\r
+ *  along with this program; if not, write to the Free Software\r
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\r
+ *  USA\r
+ *\r
+ *  $Id: listener.c 25169 2008-03-29 21:41:31Z jilles $\r
+ */\r
+\r
+#include "stdinc.h"\r
+#include "ratbox_lib.h"\r
+#include "listener.h"\r
+#include "client.h"\r
+#include "ircd.h"\r
+#include "numeric.h"\r
+#include "s_conf.h"\r
+#include "s_newconf.h"\r
+#include "s_stats.h"\r
+#include "send.h"\r
+#include "s_auth.h"\r
+#include "reject.h"\r
+#include "s_log.h"\r
+#include "hash.h"\r
+\r
 static rb_dlink_list listener_list;\r
 static int accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, void *data);\r
 static void accept_callback(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t addrlen, void *data);\r
 \r
+\r
+\r
 static struct Listener *\r
 make_listener(struct rb_sockaddr_storage *addr)\r
 {\r
@@ -178,7 +177,7 @@ inetport(struct Listener *listener)
                             get_listener_name(listener), errno);\r
                return 0;\r
        }\r
-       else if((maxconnections - 10) < rb_get_fd(F)) /* XXX this is kinda bogus*/\r
+       else if((rb_get_maxconnections() - 10) < rb_get_fd(F)) /* XXX this is kinda bogus*/\r
        {\r
                report_error("no more connections left for listener %s:%s",\r
                             get_listener_name(listener), \r
@@ -464,7 +463,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
                return 0;\r
        }\r
        \r
-       if((maxconnections - 10) < rb_get_fd(F)) /* XXX this is kinda bogus */\r
+       if((rb_get_maxconnections() - 10) < rb_get_fd(F)) /* XXX this is kinda bogus */\r
        {\r
                ++ServerStats.is_ref;\r
                /*\r