From ee241273819a6e4e4ff71e98168dff2760e2903e Mon Sep 17 00:00:00 2001 From: stskeeps Date: Thu, 14 Jun 2007 18:01:01 +0000 Subject: [PATCH] - #0002533 reported by Dodge_Ram, patched by WolfSage, regarding notices not being sent when /*line and /shun are used to request stats --- Changes | 2 ++ src/ircd.c | 1 + src/modules/m_tkl.c | 10 ++++++++++ src/s_bsd.c | 24 +++++++++++++++--------- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index f62025ef9..12262ec5a 100644 --- a/Changes +++ b/Changes @@ -1473,3 +1473,5 @@ and not -l as supposed. This may have caused desyncs - #0003368 patched by Stealth giving users access to do /module on remote servers +- #0002533 reported by Dodge_Ram, patched by WolfSage, regarding notices + not being sent when /*line and /shun are used to request stats diff --git a/src/ircd.c b/src/ircd.c index 30f381d24..02566d48a 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -1364,6 +1364,7 @@ int InitwIRCD(int argc, char *argv[]) Debug((DEBUG_ERROR, "Port = %d", portnum)); if (inetport(&me, conf_listen->ip, portnum)) exit(1); + set_non_blocking(me.fd, &me); conf_listen->options |= LISTENER_BOUND; me.umodes = conf_listen->options; conf_listen->listener = &me; diff --git a/src/modules/m_tkl.c b/src/modules/m_tkl.c index 6fb57ad04..6c6f8b590 100644 --- a/src/modules/m_tkl.c +++ b/src/modules/m_tkl.c @@ -208,6 +208,8 @@ DLLFUNC int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) tkl_stats(sptr, TKL_KILL|TKL_GLOBAL, NULL); tkl_stats(sptr, TKL_ZAP|TKL_GLOBAL, NULL); sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'g'); + sendto_snomask(SNO_EYES, "Stats \'g\' requested by %s (%s@%s)", + sptr->name, sptr->user->username, GetHost(sptr)); return 0; } @@ -232,6 +234,8 @@ DLLFUNC int m_gzline(aClient *cptr, aClient *sptr, int parc, char *parv[]) tkl_stats(sptr, TKL_GLOBAL|TKL_KILL, NULL); tkl_stats(sptr, TKL_GLOBAL|TKL_ZAP, NULL); sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'g'); + sendto_snomask(SNO_EYES, "Stats \'g\' requested by %s (%s@%s)", + sptr->name, sptr->user->username, GetHost(sptr)); return 0; } @@ -255,6 +259,8 @@ DLLFUNC int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[]) { tkl_stats(sptr, TKL_GLOBAL|TKL_SHUN, NULL); sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 's'); + sendto_snomask(SNO_EYES, "Stats \'s\' requested by %s (%s@%s)", + sptr->name, sptr->user->username, GetHost(sptr)); return 0; } @@ -386,6 +392,8 @@ DLLFUNC int m_tkline(aClient *cptr, aClient *sptr, int parc, char *parv[]) me.name, sptr->name, "E", excepts->mask, ""); } sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'k'); + sendto_snomask(SNO_EYES, "Stats \'k\' requested by %s (%s@%s)", + sptr->name, sptr->user->username, GetHost(sptr)); return 0; } if (!OPCanUnKline(sptr) && *parv[1] == '-') @@ -447,6 +455,8 @@ DLLFUNC int m_tzline(aClient *cptr, aClient *sptr, int parc, char *parv[]) me.name, sptr->name, "E", excepts->mask, ""); } sendto_one(sptr, rpl_str(RPL_ENDOFSTATS), me.name, sptr->name, 'k'); + sendto_snomask(SNO_EYES, "Stats \'k\' requested by %s (%s@%s)", + sptr->name, sptr->user->username, GetHost(sptr)); return 0; } diff --git a/src/s_bsd.c b/src/s_bsd.c index 0ade0b2a4..5b8440b12 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -1657,7 +1657,7 @@ int read_message(time_t delay, fdlist *listp) #else fd_set read_set, write_set, excpt_set; #endif - int j; + int j,k; time_t delay2 = delay, now; int res, length, fd, i; int auth = 0; @@ -1862,7 +1862,10 @@ int read_message(time_t delay, fdlist *listp) ** Thus no specific errors are tested at this ** point, just assume that connections cannot ** be accepted until some old is closed first. + * */ + for (k = 0; k < LISTEN_SIZE; k++) +{ { if ((fd = accept(cptr->fd, NULL, NULL)) < 0) { if ((ERRNO != P_EWOULDBLOCK) && (ERRNO != P_ECONNABORTED)) @@ -1890,15 +1893,18 @@ int read_message(time_t delay, fdlist *listp) CLOSE_SOCK(fd); --OpenFiles; break; - } - /* - * Use of add_connection (which never fails :) meLazy - */ - (void)add_connection(cptr, fd); - nextping = TStime(); - if (!cptr->listener) + } + /* + * Use of add_connection (which never fails :) meLazy + */ + (void)add_connection(cptr, fd); + } + } + nextping = TStime(); + if (!cptr->listener) cptr->listener = &me; - } + + } #ifndef NO_FDLIST for (i = listp->entry[j = 1]; (j <= listp->last_entry); i = listp->entry[++j]) #else