diff --git a/Changes b/Changes index 91119e9b6..5ab359125 100644 --- a/Changes +++ b/Changes @@ -518,3 +518,4 @@ seen. gmtime warning still there - Commited McSkaf's tab patch for win32 - Possible fixed fdlist problem with default_fdlist - Added some numeric checking in m_server* +- Made possible speedup of fdlist checking in s_bsd.c diff --git a/src/s_bsd.c b/src/s_bsd.c index 82f4152b8..0381d2f89 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -653,10 +653,7 @@ char logbuf[BUFSIZ]; for (fd = 3; fd < MAXCONNECTIONS; fd++) { (void)close(fd); - local[fd] = NULL; } - -local[1] = NULL; (void)close(1); if (bootopt & BOOT_TTY) /* debugging is going to a tty */ @@ -1884,7 +1881,11 @@ int read_message(delay, listp) * I really hate to do this.. but another loop * to check to see if we have any socks fd's.. - darkrot */ +#ifdef NO_FDLIST for (i = LastSlot; (socks > 0) && (i >= 0); i--) +#else + for (i = listp->entry[j = 1]; (socks > 0) && (j <= listp->last_entry); i = listp->entry[++j]) +#endif { if (!(cptr = local[i])) continue; @@ -1933,7 +1934,11 @@ int read_message(delay, listp) } #endif /* SOCKSPORT */ +#ifdef NO_FDLIST for (i = LastSlot; i >= 0; i--) +#else + for (i = listp->entry[j = 1]; (j <= listp->last_entry); i = listp->entry[++j]) +#endif if ((cptr = local[i]) && FD_ISSET(cptr->fd, &read_set) && IsListening(cptr)) { @@ -1983,8 +1988,11 @@ int read_message(delay, listp) if (!cptr->listener) cptr->listener = &me; } - +#ifndef NO_FDLIST + for (i = listp->entry[j = 1]; (j <= listp->last_entry); i = listp->entry[++j]) +#else for (i = LastSlot; i >= 0; i--) +#endif { if (!(cptr = local[i]) || IsMe(cptr)) continue; diff --git a/src/s_serv.c b/src/s_serv.c index 82eb19d0e..019368277 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -4333,8 +4333,8 @@ int m_trace(cptr, sptr, parc, parv) * trace */ sendto_one(sptr, rpl_str(RPL_TRACESERVER), - me.name, parv[0], 0, link_s[me.fd], - link_u[me.fd], me.name, "*", "*", me.name); + me.name, parv[0], 0, link_s[me.slot], + link_u[me.slot], me.name, "*", "*", me.name); return 0; } for (cltmp = conf_class; doall && cltmp; cltmp = (ConfigItem_class *) cltmp->next)