* External stuff
*--------------------------------------------------------------------------*/
extern void init_counters(void);
+extern void mem_dbg_initialise(void);
/*----------------------------------------------------------------------------
* Constants / Enums
struct ConnectionClass* cltmp;
struct ConfItem* con_conf = 0;
struct Jupe* ajupe;
- unsigned int con_class = 0;
+ const char* con_class = NULL;
assert(ET_EXPIRE == ev_type(ev));
assert(0 != ev_timer(ev));
Debug((DEBUG_NOTICE, "Connection check at : %s", myctime(CurrentTime)));
for (aconf = GlobalConfList; aconf; aconf = aconf->next) {
/* Also when already connecting! (update holdtimes) --SRB */
- if (!(aconf->status & CONF_SERVER) || aconf->port == 0)
+ if (!(aconf->status & CONF_SERVER) || aconf->port == 0 || aconf->hold == 0)
continue;
/* Also skip juped servers */
cltmp = aconf->conn_class;
confrq = get_con_freq(cltmp);
- aconf->hold = CurrentTime + confrq;
+ if(confrq == 0)
+ aconf->hold = next = 0;
+ else
+ aconf->hold = CurrentTime + confrq;
/* Found a CONNECT config with port specified, scan clients and see if
* this server is already connected?
cptr = FindServer(aconf->name);
if (!cptr && (Links(cltmp) < MaxLinks(cltmp)) &&
- (!connecting || (ConClass(cltmp) > con_class))) {
+ (!connecting /*|| (ConClass(cltmp) > con_class)*/)) {
/*
* Check connect rules to see if we're allowed to try
*/
continue;
}
- /* Quit the client after max_ping*2 - they should have answered by now */
- if (CurrentTime-cli_lasttime(cptr) >= (max_ping*2) ) {
- /* If it was a server, then tell ops about it. */
- if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr))
- sendto_opmask_butone(0, SNO_OLDSNO,
- "No response from %s, closing link",
- cli_name(cptr));
- exit_client_msg(cptr, cptr, &me, "Ping timeout");
- continue;
- }
-
/* Unregistered clients pingout after max_ping seconds, they don't
* get given a second chance - if they were then people could not quite
* finish registration and hold resources without being subject to k/g
sendcmdto_one(&me, CMD_PING, cptr, ":%s", cli_name(&me));
}
+ /* Quit the client after max_ping*2 - they should have answered by now */
+ if (CurrentTime-cli_lasttime(cptr) >= (max_ping*2) ) {
+ /* If it was a server, then tell ops about it. */
+ if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr))
+ sendto_opmask_butone(0, SNO_OLDSNO,
+ "No response from %s, closing link",
+ cli_name(cptr));
+ exit_client_msg(cptr, cptr, &me, "Ping timeout");
+ continue;
+ }
+
expire = cli_lasttime(cptr) + max_ping * 2;
if (expire < next_check)
next_check=expire;
case 'd': dpath = optarg; break;
case 'f': configfile = optarg; break;
case 'h': ircd_strncpy(cli_name(&me), optarg, HOSTLEN); break;
- case 'v': printf("ircd %s\n", version); exit(0);
+ case 'v':
+ printf("ircd %s\n", version);
+ printf("Event engines: ");
+#ifdef USE_KQUEUE
+ printf("kqueue() ");
+#endif
+#ifdef USE_DEVPOLL
+ printf("/dev/poll ");
+#endif
+#ifdef USE_POLL
+ printf("poll()");
+#else
+ printf("select()");
+#endif
+ printf("\nCompiled for a maximum of %d connections.\n", MAXCONNECTIONS);
+
+
+ exit(0);
+ break;
case 'x':
debuglevel = atoi(optarg);
thisServer.uid = getuid();
thisServer.euid = geteuid();
+#ifdef MDEBUG
+ mem_dbg_initialise();
+#endif
+
#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_CORE)
set_core_limit();
#endif