diff -c -N -r irc2.8.21+CSr19/README.CS irc2.8.21+CSr20/README.CS *** irc2.8.21+CSr19/README.CS Fri Jan 5 21:28:26 1996 --- irc2.8.21+CSr20/README.CS Sun Jan 21 11:51:06 1996 *************** *** 1,6 **** --- 1,29 ---- NOTE: Please change values in comstud.h and dog3.h to your liking... The default values are probably less than ideal for you! + New in CSr20: + + 1) Removed an #ifdef from dbuf.c which causes some problems on some OS's + 2) Fixed, and commented out a function in dich_conf() that isn't used + 3) Fixed EAGAIN problem on connect() on DG/UX, thanks to + Greg Moeller + For DGUX, add #define DGUX to config.h or comstud.h + 4) Added orabidoo's TS patch to stop wrong deop's. + 5) Patched TS to show deoppings to come from local server, not remote + asamonte@calpoly.edu helped me with this one... + 6) m_lusers (/LUSERS) now uses pre-computed info. This should save + hella CPU on heavily cliented servers + PS, my channel counting counts secret channels...the old version + of ircd did not...who knows why, but you can get the real # of + channels via /stats z anyway. + 7) Optimized the linear list for K: lines in DICH_CONF (the non-sortable ones) + 8) Removed DICH_CONF & DOUGH_HASH defines...made them part of stock +CS + Also, did the same thing for DBUF_TAIL + 9) Applied DOUGH_HASH routines to channel hashing too... + 10) Kline comment is now displayed to other real ops when the k-line is done + 11) Moved rest of nick collisions into +f + 12) Moved "Too many", "Unauth" and so forth messages into +u + New in CSr19: 1) Oops, fixed how klining with no reason will core the server =( diff -c -N -r irc2.8.21+CSr19/common/dbuf.c irc2.8.21+CSr20/common/dbuf.c *** irc2.8.21+CSr19/common/dbuf.c Fri Jan 5 17:02:14 1996 --- irc2.8.21+CSr20/common/dbuf.c Tue Jan 8 16:04:40 1980 *************** *** 44,53 **** #include "common.h" #include "sys.h" - #ifdef DOG3 - #define VALLOC - #endif - #if !defined(VALLOC) && !defined(valloc) #define valloc malloc #endif --- 44,49 ---- *************** *** 170,178 **** dyn->head = p->next; dbuf_free(p); } - #ifdef DBUF_TAIL dyn->tail = dyn->head; - #endif return -1; } --- 166,172 ---- *************** *** 183,206 **** int length; { Reg1 dbufbuf **h, *d; - #ifdef DBUF_TAIL Reg2 int off; - #else - Reg2 int nbr, off; - #endif Reg3 int chunk; off = (dyn->offset + dyn->length) % DBUFSIZ; - #ifndef DBUF_TAIL - nbr = (dyn->offset + dyn->length) / DBUFSIZ; - #endif /* ** Locate the last non-empty buffer. If the last buffer is ** full, the loop will terminate with 'd==NULL'. This loop ** assumes that the 'dyn->length' field is correctly ** maintained, as it should--no other check really needed. */ - #ifdef DBUF_TAIL if (!dyn->length) h = &(dyn->head); else --- 177,192 ---- *************** *** 210,218 **** else h = &(dyn->tail->next); } - #else - for (h = &(dyn->head); (d = *h) && --nbr >= 0; h = &(d->next)); - #endif /* DBUF_TAIL */ /* ** Append users data to buffer, allocating buffers as needed */ --- 196,201 ---- *************** *** 224,232 **** { if ((d = (dbufbuf *)dbuf_alloc()) == NULL) return dbuf_malloc_error(dyn); - #ifdef DBUF_TAIL dyn->tail = d; - #endif *h = d; d->next = NULL; } --- 207,213 ---- *************** *** 248,256 **** { if (dyn->head == NULL) { - #ifdef DBUG_TAIL dyn->tail = NULL; - #endif *length = 0; return NULL; } --- 229,235 ---- *************** *** 287,300 **** chunk = DBUFSIZ; } if (dyn->head == (dbufbuf *)NULL) - #ifdef DBUF_TAIL { dyn->tail = NULL; - #endif dyn->length = 0; - #ifdef DBUF_TAIL } - #endif return 0; } --- 266,275 ---- diff -c -N -r irc2.8.21+CSr19/common/send.c irc2.8.21+CSr20/common/send.c *** irc2.8.21+CSr19/common/send.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/common/send.c Sun Jan 21 00:08:28 1996 *************** *** 962,974 **** #ifdef USE_VARARGS va_start(vl); #endif for (i = 0; i <= highest_fd; i++) if ((cptr = local[i]) && !IsServer(cptr) && !IsMe(cptr) && (((flag == 1) && IsAnOper(cptr)) || ((flag == 2) && IsAnOper(cptr) && IsCMode(cptr)) || ((flag == 3) && IsKMode(cptr)) || ((flag == 4) && IsFMode(cptr)) || ! ((flag == 5) && IsRMode(cptr)))) { (void)irc_sprintf(nbuf, ":%s NOTICE %s :*** Notice -- ", me.name, cptr->name); --- 962,986 ---- #ifdef USE_VARARGS va_start(vl); #endif + #ifndef FK_USERMODES + if ((flag == 3) || (flag == 4) || (flag == 6)) + { + #ifndef USE_VARARGS + sendto_ops(pattern, p1, p2, p3, p4, p5, p6, p7, p8); + #else + sendto_ops(pattern, va_alist); + #endif /* USE_VARARGS */ + return; + } + #endif /* FK_USERMODES */ for (i = 0; i <= highest_fd; i++) if ((cptr = local[i]) && !IsServer(cptr) && !IsMe(cptr) && (((flag == 1) && IsAnOper(cptr)) || ((flag == 2) && IsAnOper(cptr) && IsCMode(cptr)) || ((flag == 3) && IsKMode(cptr)) || ((flag == 4) && IsFMode(cptr)) || ! ((flag == 5) && IsRMode(cptr)) || ! ((flag == 6) && IsUMode(cptr)))) { (void)irc_sprintf(nbuf, ":%s NOTICE %s :*** Notice -- ", me.name, cptr->name); diff -c -N -r irc2.8.21+CSr19/include/comstud.h irc2.8.21+CSr20/include/comstud.h *** irc2.8.21+CSr19/include/comstud.h Fri Jan 5 17:04:13 1996 --- irc2.8.21+CSr20/include/comstud.h Sun Jan 21 00:06:02 1996 *************** *** 2,22 **** #define COMSTUD_H /* RESTRICT - define this if using dog3 stuff, and wish to ! disallow /LUSERS, /LIST and other CPU ! intensive commands when in HIGH TRAFFIC MODE */ #undef RESTRICT - /* USE_DICH_CONF - define this to try a new code for K: line matching - - Note: This is a lot cleaner than Roy's kline - patches...as far as CPU usage...someone want to - test it? =) - - Also, this was written by Philippe Levan, not me =) - */ - - #define USE_DICH_CONF - /* B_LINES - Define this if you wish to ignore ip#'s or hosts from being tested for bots or clonebots... B:*eskimo.com::* will not check for bots or --- 2,13 ---- #define COMSTUD_H /* RESTRICT - define this if using dog3 stuff, and wish to ! disallow /LIST and other CPU intensive commands ! when in HIGH TRAFFIC MODE */ #undef RESTRICT /* B_LINES - Define this if you wish to ignore ip#'s or hosts from being tested for bots or clonebots... B:*eskimo.com::* will not check for bots or *************** *** 57,75 **** #define DOG3 - /* DOUGH_HASH - define this if you want to use no_nick's - hashing routines...(suggested) - */ - - #define DOUGH_HASH - - - /* DBUF_TAIL - define this if you'd like to use improved - performance dealing with dbufs... - */ - - #undef DBUF_TAIL - /* DBUF_INIT - define this if you want to pre-allocate 4 megs of dbufs...this should help in the long run according to dog3 =) --- 48,53 ---- *************** *** 121,127 **** #define TOPIC_INFO ! /* SIGNON_TIME - define this if you want to see when i user signed into irc when doing /whois */ --- 99,105 ---- #define TOPIC_INFO ! /* SIGNON_TIME - define this if you want to see when a user signed into irc when doing /whois */ *************** *** 136,142 **** /* NO_RED_MODES - define this if you don't want redundant modes i.e., if someone is opped they can't be opped /mode +ooo nick nick nick results in ! /mode * +o nick */ #define NO_RED_MODES --- 114,120 ---- /* NO_RED_MODES - define this if you don't want redundant modes i.e., if someone is opped they can't be opped /mode +ooo nick nick nick results in ! /mode * +o nick */ #define NO_RED_MODES *************** *** 221,227 **** want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr19/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c --- 199,205 ---- want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr20/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c *************** *** 296,302 **** and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr19/lib/logs/clones.log" /* THE REST OF THIS STUFF IS TO CONFIGURE CLONE CHECKING */ --- 274,280 ---- and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr20/lib/logs/clones.log" /* THE REST OF THIS STUFF IS TO CONFIGURE CLONE CHECKING */ diff -c -N -r irc2.8.21+CSr19/include/config.h irc2.8.21+CSr20/include/config.h *** irc2.8.21+CSr19/include/config.h Fri Jan 5 17:04:23 1996 --- irc2.8.21+CSr20/include/config.h Sun Jan 21 01:51:18 1996 *************** *** 46,51 **** --- 46,52 ---- #undef ESIX /* ESIX */ #undef NEXT /* NeXTStep */ #undef SVR4 + #undef DGUX /* Do these work? I dunno... */ *************** *** 107,114 **** * these are only the recommened names and paths. Change as needed. * You must define these to something, even if you don't really want them. */ ! #define DPATH "/home/irc/irc2.8.21+CSr19/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr19/lib/ircd" #define CPATH "ircd.conf" /* server configuration file */ #define MPATH "ircd.motd" /* server MOTD file */ #define LPATH "ircd.log" /* Where the debug file lives, if DEBUGMODE */ --- 108,115 ---- * these are only the recommened names and paths. Change as needed. * You must define these to something, even if you don't really want them. */ ! #define DPATH "/home/irc/irc2.8.21+CSr20/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr20/lib/ircd" #define CPATH "ircd.conf" /* server configuration file */ #define MPATH "ircd.motd" /* server MOTD file */ #define LPATH "ircd.log" /* Where the debug file lives, if DEBUGMODE */ *************** *** 122,129 **** * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr19/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr19/logs/opers.log" /* */ /* CHROOTDIR * --- 123,130 ---- * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr20/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr20/logs/opers.log" /* */ /* CHROOTDIR * diff -c -N -r irc2.8.21+CSr19/include/dbuf.h irc2.8.21+CSr20/include/dbuf.h *** irc2.8.21+CSr19/include/dbuf.h Fri Jan 5 17:02:14 1996 --- irc2.8.21+CSr20/include/dbuf.h Tue Jan 8 16:04:54 1980 *************** *** 49,57 **** u_int length; /* Current number of bytes stored */ u_int offset; /* Offset to the first byte */ struct dbufbuf *head; /* First data buffer, if length > 0 */ - #ifdef DBUF_TAIL struct dbufbuf *tail; /* last data buffer, if length > 0 */ - #endif } dbuf; #else typedef struct dbuf --- 49,55 ---- *************** *** 59,67 **** uint length; /* Current number of bytes stored */ uint offset; /* Offset to the first byte */ struct dbufbuf *head; /* First data buffer, if length > 0 */ - #ifdef DBUF_TAIL struct dbufbuf *tail; /* last data buffer, if length > 0 */ - #endif } dbuf; #endif /* --- 57,63 ---- diff -c -N -r irc2.8.21+CSr19/include/h.h irc2.8.21+CSr20/include/h.h *** irc2.8.21+CSr19/include/h.h Fri Jan 5 17:02:14 1996 --- irc2.8.21+CSr20/include/h.h Sat Jan 20 23:33:15 1996 *************** *** 26,40 **** #include "comstud.h" #if defined(USE_DICH_CONF) || defined(B_LINES) || defined(E_LINES) #include "dich_conf.h" #endif - #ifdef USE_DICH_CONF extern aConfList KList1; /* ordered */ extern aConfList KList2; /* ordered, reversed */ extern aConfList KList3; /* what we can't sort */ - #endif /* USE_DICH_CONF */ #ifdef B_LINES extern aConfList BList1; /* ordered */ --- 26,46 ---- #include "comstud.h" + #ifdef HIGHEST_CONNECTION + extern void check_max_count(); + #endif /* HIGHEST_CONNECTION */ + + extern int s_count, c_count, ch_count, u_count, i_count; + extern int o_count, m_clients, m_servers, m_invis; + extern void compute_lusers(); + #if defined(USE_DICH_CONF) || defined(B_LINES) || defined(E_LINES) #include "dich_conf.h" #endif extern aConfList KList1; /* ordered */ extern aConfList KList2; /* ordered, reversed */ extern aConfList KList3; /* what we can't sort */ #ifdef B_LINES extern aConfList BList1; /* ordered */ *************** *** 81,87 **** extern int can_send PROTO((aClient *, aChannel *)); extern int is_chan_op PROTO((aClient *, aChannel *)); extern int has_voice PROTO((aClient *, aChannel *)); ! extern int count_channels PROTO((aClient *)); extern aClient *find_chasing PROTO((aClient *, char *, int *)); extern aClient *find_client PROTO((char *, aClient *)); --- 87,93 ---- extern int can_send PROTO((aClient *, aChannel *)); extern int is_chan_op PROTO((aClient *, aChannel *)); extern int has_voice PROTO((aClient *, aChannel *)); ! extern int count_channels PROTO(()); extern aClient *find_chasing PROTO((aClient *, char *, int *)); extern aClient *find_client PROTO((char *, aClient *)); diff -c -N -r irc2.8.21+CSr19/include/hash.h irc2.8.21+CSr20/include/hash.h *** irc2.8.21+CSr19/include/hash.h Fri Jan 5 17:02:14 1996 --- irc2.8.21+CSr20/include/hash.h Sat Jan 20 22:41:44 1996 *************** *** 26,34 **** void *list; } aHashEntry; - #define DEFAULT_HASHSIZE 16333 /* prime number */ - #define DEFAULT_CHANNELHASHSIZE 7019 /* prime number */ - extern int HASHSIZE; extern int CHANNELHASHSIZE; --- 26,31 ---- diff -c -N -r irc2.8.21+CSr19/include/patchlevel.h irc2.8.21+CSr20/include/patchlevel.h *** irc2.8.21+CSr19/include/patchlevel.h Fri Jan 5 17:04:07 1996 --- irc2.8.21+CSr20/include/patchlevel.h Mon Jan 8 20:33:43 1996 *************** *** 17,21 **** */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr19" #endif --- 17,21 ---- */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr20" #endif diff -c -N -r irc2.8.21+CSr19/ircd/channel.c irc2.8.21+CSr20/ircd/channel.c *** irc2.8.21+CSr19/ircd/channel.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/channel.c Sun Jan 21 17:52:59 1996 *************** *** 1377,1382 **** --- 1377,1383 ---- chptr->nextch = channel; channel = chptr; (void)add_to_channel_hash_table(chname, chptr); + ch_count++; } return chptr; } *************** *** 1484,1489 **** --- 1485,1491 ---- chptr->nextch->prevch = chptr->prevch; (void)del_from_channel_hash_table(chptr->chname, chptr); MyFree((char *)chptr); + ch_count--; } } *************** *** 1835,1855 **** return (0); } ! int count_channels(sptr) ! aClient *sptr; { ! Reg1 aChannel *chptr; Reg2 int count = 0; for (chptr = channel; chptr; chptr = chptr->nextch) - #ifdef SHOW_INVISIBLE_LUSERS - if (SecretChannel(chptr)) - { - if (IsAnOper(sptr)) - count++; - } - else - #endif count++; return (count); } --- 1837,1848 ---- return (0); } ! int count_channels() { ! Reg1 aChannel *chptr; Reg2 int count = 0; for (chptr = channel; chptr; chptr = chptr->nextch) count++; return (count); } *************** *** 2298,2308 **** return; } ! static void sjoin_sendit(cptr, sptr, chptr, from) aClient *cptr; aClient *sptr; aChannel *chptr; char *from; { sendto_channel_butserv(chptr, sptr, ":%s MODE %s %s %s", from, chptr->chname, modebuf, parabuf); --- 2291,2303 ---- return; } ! static void sjoin_sendit(cptr, sptr, chptr, from, modebuf, parabuf) aClient *cptr; aClient *sptr; aChannel *chptr; char *from; + char *modebuf; + char *parabuf; { sendto_channel_butserv(chptr, sptr, ":%s MODE %s %s %s", from, chptr->chname, modebuf, parabuf); *************** *** 2338,2347 **** static Mode mode, *oldmode; Link *l; int args = 0, haveops = 0, keepourmodes = 1, keepnewmodes = 1, ! doesop = 0, what = 0, pargs = 0, *ip, fl, people = 0; Reg1 char *s, *s0; static char numeric[16], sjbuf[BUFSIZE]; char *mbuf = modebuf, *t = sjbuf, *p; static int flags[] = { MODE_PRIVATE, 'p', MODE_SECRET, 's', --- 2333,2347 ---- static Mode mode, *oldmode; Link *l; int args = 0, haveops = 0, keepourmodes = 1, keepnewmodes = 1, ! doesop = 0, mewhat = 0, pargs = 0, *ip, fl, people = 0, isnew, ! mpargs = 0, opargs = 0, othwhat = 0; Reg1 char *s, *s0; static char numeric[16], sjbuf[BUFSIZE]; char *mbuf = modebuf, *t = sjbuf, *p; + char othmodebuf[MODEBUFLEN], othparabuf[MODEBUFLEN]; + char memodebuf[MODEBUFLEN], meparabuf[MODEBUFLEN]; + char *ombuf = othmodebuf; + char *mmbuf = memodebuf; static int flags[] = { MODE_PRIVATE, 'p', MODE_SECRET, 's', *************** *** 2349,2354 **** --- 2349,2355 ---- MODE_TOPICLIMIT, 't', MODE_INVITEONLY, 'i', 0x0, 0x0 }; + if (check_registered(sptr) || IsClient(sptr) || parc < 5) return 0; if (!IsChannelName(parv[2]) || *************** *** 2356,2362 **** return 0; newts = atol(parv[1]); bzero((char *)&mode, sizeof(mode)); ! s = parv[3]; while (*s) switch(*(s++)) --- 2357,2364 ---- return 0; newts = atol(parv[1]); bzero((char *)&mode, sizeof(mode)); ! *ombuf = *mmbuf = (char) 0; ! meparabuf[0] = othparabuf[0] = (char) 0; s = parv[3]; while (*s) switch(*(s++)) *************** *** 2393,2398 **** --- 2395,2401 ---- *parabuf = '\0'; + isnew = ChannelExists(parv[2]) ? 0 : 1; chptr = get_channel(sptr, parv[2], CREATE); oldts = chptr->channelts; doesop = (parv[4+args][0] == '@' || parv[4+args][1] == '@'); *************** *** 2406,2422 **** oldmode = &chptr->mode; ! if (newts == 0) ! if (haveops || !doesop) ! tstosend = oldts; ! else ! chptr->channelts = tstosend = 0; ! else if (oldts == 0) ! if (doesop || !haveops) ! chptr->channelts = tstosend = newts; ! else ! tstosend = 0; ! else if (newts == oldts) tstosend = oldts; else if (newts < oldts) { --- 2409,2419 ---- oldmode = &chptr->mode; ! if (isnew) ! chptr->channelts = tstosend = newts; ! else if (newts == 0 || oldts == 0) ! chptr->channelts = tstosend = 0; ! else if (newts == oldts) tstosend = oldts; else if (newts < oldts) { *************** *** 2455,2586 **** for (ip = flags; *ip; ip += 2) if ((*ip & mode.mode) && !(*ip & oldmode->mode)) ! { ! if (what != 1) ! { ! *mbuf++ = '+'; ! what = 1; ! } ! *mbuf++ = *(ip+1); ! } for (ip = flags; *ip; ip += 2) if ((*ip & oldmode->mode) && !(*ip & mode.mode)) ! { ! if (what != -1) ! { ! *mbuf++ = '-'; ! what = -1; ! } ! *mbuf++ = *(ip+1); ! } if (oldmode->limit && !mode.limit) ! { ! if (what != -1) ! { ! *mbuf++ = '-'; ! what = -1; ! } ! *mbuf++ = 'l'; ! } if (oldmode->key[0] && !mode.key[0]) ! { ! if (what != -1) ! { ! *mbuf++ = '-'; ! what = -1; ! } ! *mbuf++ = 'k'; ! strcat(parabuf, oldmode->key); ! strcat(parabuf, " "); ! pargs++; ! } if (mode.limit && oldmode->limit != mode.limit) { ! if (what != 1) { ! *mbuf++ = '+'; ! what = 1; } ! *mbuf++ = 'l'; (void)sprintf(numeric, "%-15d", mode.limit); if ((s = index(numeric, ' '))) *s = '\0'; ! strcat(parabuf, numeric); ! strcat(parabuf, " "); ! pargs++; } if (mode.key[0] && strcmp(oldmode->key, mode.key)) { ! if (what != 1) { ! *mbuf++ = '+'; ! what = 1; } ! *mbuf++ = 'k'; ! strcat(parabuf, mode.key); ! strcat(parabuf, " "); ! pargs++; } chptr->mode = mode; if (!keepourmodes) ! { ! what = 0; for (l = chptr->members; l && l->value.cptr; l = l->next) ! { if (l->flags & MODE_CHANOP) ! { ! if (what != -1) ! { ! *mbuf++ = '-'; ! what = -1; ! } ! *mbuf++ = 'o'; ! strcat(parabuf, l->value.cptr->name); ! strcat(parabuf, " "); ! pargs++; ! if (pargs >= (MAXMODEPARAMS-2)) ! { ! *mbuf = '\0'; sjoin_sendit(cptr, sptr, chptr, ! parv[0]); ! mbuf = modebuf; ! *mbuf = parabuf[0] = '\0'; ! pargs = what = 0; ! } l->flags &= ~MODE_CHANOP; ! } if (l->flags & MODE_VOICE) ! { ! if (what != -1) ! { ! *mbuf++ = '-'; ! what = -1; ! } ! *mbuf++ = 'v'; ! strcat(parabuf, l->value.cptr->name); ! strcat(parabuf, " "); ! pargs++; ! if (pargs >= (MAXMODEPARAMS-2)) ! { ! *mbuf = '\0'; sjoin_sendit(cptr, sptr, chptr, ! parv[0]); ! mbuf = modebuf; ! *mbuf = parabuf[0] = '\0'; ! pargs = what = 0; ! } l->flags &= ~MODE_VOICE; } ! } ! } ! if (mbuf != modebuf) ! { ! *mbuf = '\0'; ! sjoin_sendit(cptr, sptr, chptr, parv[0]); ! } *modebuf = *parabuf = '\0'; if (parv[3][0] != '0' && keepnewmodes) channel_modes(sptr, modebuf, parabuf, chptr); --- 2452,2593 ---- for (ip = flags; *ip; ip += 2) if ((*ip & mode.mode) && !(*ip & oldmode->mode)) ! { ! if (othwhat != 1) ! { ! *ombuf++ = '+'; ! othwhat = 1; ! } ! *ombuf++ = *(ip+1); ! } for (ip = flags; *ip; ip += 2) if ((*ip & oldmode->mode) && !(*ip & mode.mode)) ! { ! if (mewhat != -1) ! { ! *mmbuf++ = '-'; ! mewhat = -1; ! } ! *mmbuf++ = *(ip+1); ! } if (oldmode->limit && !mode.limit) ! { ! if (mewhat != -1) ! { ! *mmbuf++ = '-'; ! mewhat = -1; ! } ! *mmbuf++ = 'l'; ! } if (oldmode->key[0] && !mode.key[0]) ! { ! if (mewhat != -1) ! { ! *mmbuf++ = '-'; ! mewhat = -1; ! } ! *mmbuf++ = 'k'; ! strcat(meparabuf, oldmode->key); ! strcat(meparabuf, " "); ! mpargs++; ! } if (mode.limit && oldmode->limit != mode.limit) { ! if (othwhat != 1) { ! *ombuf++ = '+'; ! othwhat = 1; } ! *ombuf++ = 'l'; (void)sprintf(numeric, "%-15d", mode.limit); if ((s = index(numeric, ' '))) *s = '\0'; ! strcat(othparabuf, numeric); ! strcat(othparabuf, " "); ! opargs++; } if (mode.key[0] && strcmp(oldmode->key, mode.key)) { ! if (othwhat != 1) { ! *ombuf++ = '+'; ! othwhat = 1; } ! *ombuf++ = 'k'; ! strcat(othparabuf, mode.key); ! strcat(othparabuf, " "); ! opargs++; } chptr->mode = mode; if (!keepourmodes) ! { ! mewhat = 0; for (l = chptr->members; l && l->value.cptr; l = l->next) ! { if (l->flags & MODE_CHANOP) ! { ! if (mewhat != -1) ! { ! *mmbuf++ = '-'; ! mewhat = -1; ! } ! *mmbuf++ = 'o'; ! strcat(meparabuf, l->value.cptr->name); ! strcat(meparabuf, " "); ! mpargs++; ! if (mpargs >= (MAXMODEPARAMS-2)) ! { ! *mmbuf = '\0'; sjoin_sendit(cptr, sptr, chptr, ! me.name, ! memodebuf, meparabuf); ! mmbuf = memodebuf; ! *mmbuf = meparabuf[0] = '\0'; ! mpargs = mewhat = 0; ! } l->flags &= ~MODE_CHANOP; ! } if (l->flags & MODE_VOICE) ! { ! if (mewhat != -1) ! { ! *mmbuf++ = '-'; ! mewhat = -1; ! } ! *mmbuf++ = 'v'; ! strcat(meparabuf, l->value.cptr->name); ! strcat(meparabuf, " "); ! mpargs++; ! if (mpargs >= (MAXMODEPARAMS-2)) ! { ! *mmbuf = '\0'; sjoin_sendit(cptr, sptr, chptr, ! me.name, memodebuf, ! meparabuf); ! mmbuf = memodebuf; ! *mmbuf = meparabuf[0] = '\0'; ! mpargs = mewhat = 0; ! } l->flags &= ~MODE_VOICE; } ! } /* for() */ ! } /* if (!keepourmodes) */ + if (mmbuf != memodebuf) + { + *mmbuf = '\0'; + sjoin_sendit(cptr, sptr, chptr, me.name, memodebuf, + meparabuf); + } + if (ombuf != othmodebuf) + { + *ombuf = '\0'; + sjoin_sendit(cptr, sptr, chptr, parv[0], othmodebuf, + othparabuf); + } + *modebuf = *parabuf = '\0'; if (parv[3][0] != '0' && keepnewmodes) channel_modes(sptr, modebuf, parabuf, chptr); *************** *** 2642,2648 **** if (pargs >= (MAXMODEPARAMS-2)) { *mbuf = '\0'; ! sjoin_sendit(cptr, sptr, chptr, parv[0]); mbuf = modebuf; *mbuf++ = '+'; parabuf[0] = '\0'; --- 2649,2656 ---- if (pargs >= (MAXMODEPARAMS-2)) { *mbuf = '\0'; ! sjoin_sendit(cptr, sptr, chptr, parv[0], ! modebuf, parabuf); mbuf = modebuf; *mbuf++ = '+'; parabuf[0] = '\0'; *************** *** 2658,2664 **** if (pargs >= (MAXMODEPARAMS-2)) { *mbuf = '\0'; ! sjoin_sendit(cptr, sptr, chptr, parv[0]); mbuf = modebuf; *mbuf++ = '+'; parabuf[0] = '\0'; --- 2666,2673 ---- if (pargs >= (MAXMODEPARAMS-2)) { *mbuf = '\0'; ! sjoin_sendit(cptr, sptr, chptr, parv[0], ! modebuf, parabuf); mbuf = modebuf; *mbuf++ = '+'; parabuf[0] = '\0'; *************** *** 2669,2675 **** *mbuf = '\0'; if (pargs) ! sjoin_sendit(cptr, sptr, chptr, parv[0]); if (people) { if (t[-1] == ' ') --- 2678,2684 ---- *mbuf = '\0'; if (pargs) ! sjoin_sendit(cptr, sptr, chptr, parv[0], modebuf, parabuf); if (people) { if (t[-1] == ' ') diff -c -N -r irc2.8.21+CSr19/ircd/dich_conf.c irc2.8.21+CSr20/ircd/dich_conf.c *** irc2.8.21+CSr19/ircd/dich_conf.c Fri Jan 5 17:02:16 1996 --- irc2.8.21+CSr20/ircd/dich_conf.c Sat Jan 20 23:59:47 1996 *************** *** 1,6 **** /************************************************************************ * IRC - Internet Relay Chat, ircd/dich_conf.c ! * Copyright (C) 1995 Philippe Levan * * 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 --- 1,6 ---- /************************************************************************ * IRC - Internet Relay Chat, ircd/dich_conf.c ! * Copyright (C) 1995-1996 Philippe Levan * * 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 *************** *** 49,82 **** #include "h.h" #include "dich_conf.h" ! #ifndef SYSV #define memmove(x,y,N) bcopy(y,x,N) #endif ! void report_conf_links(sptr, List, numeric, c) ! aClient *sptr; ! aConfList *List; ! int numeric; ! char c; ! { ! register aConfItem *tmp; ! register int current; ! char *host, *pass, *name; ! static char null[] = ""; ! int port; if (!List || !List->conf_list) return; for (current = 0; current < List->length; current++) { ! aConfEntry *ptr = &List->conf_list[current]; ! for(;ptr;ptr=ptr->next) { if (ptr->sub) report_conf_links(sptr, ptr->sub, numeric, c); ! if (!(tmp=ptr->conf)) continue; host = BadPtr(tmp->host) ? null : tmp->host; pass = BadPtr(tmp->passwd) ? null : tmp->passwd; --- 49,87 ---- #include "h.h" #include "dich_conf.h" ! #if !defined(SYSV) && !defined(SOL20) #define memmove(x,y,N) bcopy(y,x,N) #endif ! /* ! * This function is used for /stats commands if you use dich_conf. ! * Thank you to Chris Behrens for this addition -Sol ! */ ! void ! report_conf_links(sptr, List, numeric, c) ! aClient *sptr; ! aConfList *List; ! int numeric; ! char *c; ! { ! register aConfItem *tmp; ! register int current; ! char *host, *pass, *name; ! static char null[] = ""; ! int port; if (!List || !List->conf_list) return; for (current = 0; current < List->length; current++) { ! aConfEntry *ptr = &List->conf_list[current]; ! for(; ptr; ptr = ptr->next) { if (ptr->sub) report_conf_links(sptr, ptr->sub, numeric, c); ! if (!(tmp = ptr->conf)) continue; host = BadPtr(tmp->host) ? null : tmp->host; pass = BadPtr(tmp->passwd) ? null : tmp->passwd; *************** *** 87,104 **** sptr->name, c, host, pass, name, port, get_conf_class(tmp)); else ! sendto_one(sptr, rpl_str(numeric), me.name, sptr->name, c, host, name, port, get_conf_class(tmp)); } ! } } void reverse(s1, s2) char *s1; char *s2; { ! char *start_point; start_point = s2; --- 92,114 ---- sptr->name, c, host, pass, name, port, get_conf_class(tmp)); else ! sendto_one(sptr, rpl_str(numeric), me.name, sptr->name, c, host, name, port, get_conf_class(tmp)); } ! } } + /* + * The following function reverses string s2 into string s1 (space for + * s1 must have been pre-allocated. + * Thanks to Diane Bruce. -Sol + */ void reverse(s1, s2) char *s1; char *s2; { ! char *start_point; start_point = s2; *************** *** 133,151 **** return 0; /* reject strings with '?' as non-sortable whoever uses '?' patterns anyway ? -Sol */ ! for (p=my_string;*p && (*p == '*');p++); if (!*p) return 0; /* only wildcards, not good -Sol */ ! for (;*p && *p != '*';p++); if (!*p) return -1; /* string of the form *word : needs reversal -Sol */ rev = (char *) MyMalloc(strlen(my_string)+1); reverse(rev, my_string); ! for (p=rev;*p && (*p == '*');p++); ! for (;*p && *p != '*';p++); if (!*p) { MyFree(rev); --- 143,161 ---- return 0; /* reject strings with '?' as non-sortable whoever uses '?' patterns anyway ? -Sol */ ! for (p = my_string; *p == '*'; p++); if (!*p) return 0; /* only wildcards, not good -Sol */ ! for (; *p && *p != '*'; p++); if (!*p) return -1; /* string of the form *word : needs reversal -Sol */ rev = (char *) MyMalloc(strlen(my_string)+1); reverse(rev, my_string); ! for (p = rev; *p == '*'; p++); ! for (; *p && *p != '*'; p++); if (!*p) { MyFree(rev); *************** *** 221,226 **** --- 231,237 ---- return tmp; } + /* char * rev_name_field(my_conf) aConfItem *my_conf; *************** *** 236,246 **** else ptr = my_conf->host; tmp = (char *) MyMalloc(strlen(ptr)+1); ! strcpy(tmp, ptr); ! reverse(tmp); return tmp; } /* * In order not to realloc memory space each time we add an entry, we do it --- 247,257 ---- else ptr = my_conf->host; tmp = (char *) MyMalloc(strlen(ptr)+1); ! reverse(tmp, ptr); return tmp; } + */ /* * In order not to realloc memory space each time we add an entry, we do it *************** *** 260,266 **** aConfEntry *new; new = (aConfEntry *) MyMalloc((length+100)*sizeof(aConfEntry)); - memcpy(new, base, length*sizeof(aConfEntry)); if (base) { memcpy(new, base, length*sizeof(aConfEntry)); --- 271,276 ---- *************** *** 425,432 **** * As the name says : this clears a configuration list. -Sol */ void ! clear_conf_list(my_list) aConfList *my_list; { if (!my_list) return; --- 435,443 ---- * As the name says : this clears a configuration list. -Sol */ void ! clear_conf_list(my_list, clear_conf) aConfList *my_list; + int clear_conf; { if (!my_list) return; *************** *** 437,473 **** /* Loop through all patterns to free conf-entries with the same pattern -Sol */ ! for (current = 0; current < my_list->length; current++) ! { ! aConfEntry *ptr = &my_list->conf_list[current]; ! ! if (ptr->sub) ! { ! clear_conf_list(ptr->sub); ! MyFree(ptr->sub); ! } ! if (ptr->conf) free_conf(ptr->conf); ! while (ptr->next) ! { ! aConfEntry *tmp = ptr->next->next; ! ! if (ptr->next->pattern) ! MyFree(ptr->next->pattern); ! if (ptr->next->sub) ! { ! clear_conf_list(ptr->next->sub); ! MyFree(ptr->next->sub); ! } ! if (ptr->next->conf) free_conf(ptr->next->conf); ! MyFree(ptr->next); ! ptr->next = tmp; ! } ! if (ptr->pattern) ! MyFree(ptr->pattern); ! } ! MyFree(my_list->conf_list); } my_list->length = 0; --- 448,481 ---- /* Loop through all patterns to free conf-entries with the same pattern -Sol */ ! for (current = 0; current < my_list->length; current++) ! { ! aConfEntry *ptr = &my_list->conf_list[current]; ! ! if (ptr->sub) ! { ! clear_conf_list(ptr->sub, clear_conf); ! MyFree(ptr->sub); ! } ! if (clear_conf && ptr->conf) free_conf(ptr->conf); ! while (ptr->next) ! { ! aConfEntry *tmp = ptr->next->next; ! ! if (ptr->next->pattern) ! MyFree(ptr->next->pattern); ! if (clear_conf && ptr->next->conf) free_conf(ptr->next->conf); ! /* No need to check ptr->next->sub because ! a next never has a sub. -Sol */ ! MyFree(ptr->next); ! ptr->next = tmp; ! } ! if (ptr->pattern) ! MyFree(ptr->pattern); ! } ! MyFree(my_list->conf_list); } my_list->length = 0; *************** *** 553,561 **** } /* ! * This simply adds a configuration line at the end of the list. ! * Of course, it makes no sense to use addto_conf_list() and ! * l_addto_conf_list() on the same list unless you want to garble it. -Sol */ void l_addto_conf_list(my_list, my_conf, cmp_field) --- 561,570 ---- } /* ! * Builds a list for non-sortable entries. ! * It doesn't respect at all the semantics of the date structure but only ! * uses it as a storage. ! * Rewritten by Chris Behrens. -Sol */ void l_addto_conf_list(my_list, my_conf, cmp_field) *************** *** 564,632 **** char *(*cmp_field)(); { char *field = cmp_field(my_conf); - unsigned int length = my_list->length; aConfEntry *base; ! (void) grow_list(my_list); ! base = my_list->conf_list; ! base[length].pattern = field; ! base[length].conf = my_conf; ! base[length].next = NULL; ! base[length].sub = NULL; ! my_list->length++; } /* * This looks for the first match in the list if my_list and tomatch are both * not NULL, otherwise it will return the next match. * NULL means there are no (more) matches. ! * This should be used only on lists created with l_addto_conf_list() since ! * it won't test the "next" attribute of aConfEntry, therefore missing entries ! * if there were chained entries. -Sol */ aConfItem * l_find_matching_conf(my_list, tomatch) aConfList *my_list; char *tomatch; { ! static aConfEntry *base; ! static unsigned int current; ! static unsigned int length; ! static char *name; if (my_list && tomatch) if (!my_list->length) { ! current = -1; return NULL; } - - if (!my_list || !tomatch) - { - if (current == -1) - return NULL; - current++; - } - else - { base = my_list->conf_list; - current = 0; - length = my_list->length; name = tomatch; } ! ! while (current < length) { ! if (!base[current].pattern) ! return base[current].conf; /* Let's say NULL ! matches all -Sol */ ! else ! if (!matches(base[current].pattern, name)) ! return base[current].conf; ! current++; } ! current = -1; ! return NULL; } --- 573,628 ---- char *(*cmp_field)(); { char *field = cmp_field(my_conf); aConfEntry *base; ! base = (aConfEntry *) MyMalloc(sizeof(aConfEntry)); ! base->pattern = field; ! base->conf = my_conf; ! base->next = my_list->conf_list; ! base->sub = NULL; ! my_list->conf_list = base; ! if (!my_list->length) ! my_list->length++; } /* * This looks for the first match in the list if my_list and tomatch are both * not NULL, otherwise it will return the next match. * NULL means there are no (more) matches. ! * This will always ignore sub fields, hence should be used with lists built ! * by l_addto_conf_list() only. ! * Modified to be used with Chris Behrens's version of l_addto_conf_list(). ! * -Sol */ aConfItem * l_find_matching_conf(my_list, tomatch) aConfList *my_list; char *tomatch; { ! static aConfEntry *base = NULL; ! static char *name = NULL; if (my_list && tomatch) + { if (!my_list->length) { ! base = NULL; return NULL; } base = my_list->conf_list; name = tomatch; } ! else if (!base || !name) { ! base = NULL; ! return NULL; } + else + base = base->next; + + while (base && matches(base->pattern, name)) + base = base->next; ! return base ? base->conf : NULL; } diff -c -N -r irc2.8.21+CSr19/ircd/hash.c irc2.8.21+CSr20/ircd/hash.c *** irc2.8.21+CSr19/ircd/hash.c Fri Jan 5 17:05:17 1996 --- irc2.8.21+CSr20/ircd/hash.c Sun Jan 21 16:11:58 1996 *************** *** 26,49 **** #include "hash.h" #include "h.h" - #ifdef DOUGH_HASH #define MAX_INITIAL 4096 #define MAX_INITIAL_MASK (MAX_INITIAL-1) #define BITS_PER_COL 3 #define BITS_PER_COL_MASK 0x7 #define MAX_SUB (1<> 1) + lower; ! hname++; ! } ! return ((hash & CH_MAX_INITIAL_MASK) << BITS_PER_COL) + ! (hash2 & BITS_PER_COL_MASK); } /* diff -c -N -r irc2.8.21+CSr19/ircd/ircd.c irc2.8.21+CSr20/ircd/ircd.c *** irc2.8.21+CSr19/ircd/ircd.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/ircd.c Sat Jan 20 23:38:02 1996 *************** *** 35,51 **** #include #include #include "h.h" - - #if defined(USE_DICH_CONF) || defined(B_LINES) || defined(E_LINES) #include "dich_conf.h" - #endif - #ifdef USE_DICH_CONF /* Lists to do K: line matching -Sol */ aConfList KList1 = { 0, NULL }; /* ordered */ aConfList KList2 = { 0, NULL }; /* ordered, reversed */ aConfList KList3 = { 0, NULL }; /* what we can't sort */ - #endif /* USE_DICH_CONF */ #ifdef B_LINES /* Lists to do B: line matching -Sol */ --- 35,46 ---- *************** *** 60,65 **** --- 55,69 ---- aConfList EList3 = { 0, NULL }; /* what we can't sort */ #endif /* E_LINES */ + int s_count = 1; /* All servers */ + int c_count = 0; /* All clients */ + int ch_count = 0; /* All channels */ + int i_count = 0; /* All invisible users */ + int o_count = 0; /* All operators */ + int m_clients = 0; /* My clients */ + int m_servers = 0; /* My servers */ + int m_invis = 0; /* My invisible users */ + #ifdef DOG3 #include "dog3.h" *************** *** 302,307 **** --- 306,314 ---- return (next); } + /* These can be removed when we know static lusers works */ + extern int s_ct, c_ct, i_ct, o_ct, m_cs, m_ss, m_is; + static time_t check_pings(currenttime) time_t currenttime; { *************** *** 313,322 **** if (rehashed || (currenttime-lastcheck > KLINE_CHECK)) { lastcheck = currenttime; checkit = 1; rehashed = 0; ! } for (i = 0; i <= highest_fd; i++) { if (!(cptr = local[i]) || IsMe(cptr) || IsLog(cptr)) --- 320,363 ---- if (rehashed || (currenttime-lastcheck > KLINE_CHECK)) { + int ch_ct; + lastcheck = currenttime; checkit = 1; rehashed = 0; ! /* Can be removed when we know static lusers works */ ! compute_lusers(NULL); ! ch_ct = count_channels(); ! if (ch_ct != ch_count) ! sendto_ops("Channel count updated, was off by %i", ! ch_count-ch_ct); ! if (s_ct != s_count) ! sendto_ops("Server count updated, was off by %i", ! s_count-s_ct); ! if (c_ct != c_count) ! sendto_ops("Client count updated, was off by %i", ! c_count-c_ct); ! if (i_ct != i_count) ! sendto_ops("Invis count updated, was off by %i", ! i_count-i_ct); ! if (o_ct != o_ct) ! sendto_ops("Oper count updated, was off by %i", ! o_count-o_ct); ! if (m_cs != m_clients) ! sendto_ops("My clients updated, was off by %i", ! m_clients-m_cs); ! if (m_ss != m_servers) ! sendto_ops("My servers updated, was off by %i", ! m_servers-m_ss); ! ch_count = ch_ct; ! s_count = s_ct; ! c_count = c_ct; ! i_count = i_ct; ! o_count = o_ct; ! m_clients = m_cs; ! m_servers = m_ss; ! m_invis = m_is; ! } for (i = 0; i <= highest_fd; i++) { if (!(cptr = local[i]) || IsMe(cptr) || IsLog(cptr)) diff -c -N -r irc2.8.21+CSr19/ircd/list.c irc2.8.21+CSr20/ircd/list.c *** irc2.8.21+CSr19/ircd/list.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/list.c Sun Jan 21 16:04:16 1996 *************** *** 236,241 **** --- 236,251 ---- void remove_client_from_list(cptr) Reg1 aClient *cptr; { + if (IsServer(cptr)) + s_count--; + if (IsClient(cptr)) + { + if (IsInvisible(cptr)) + i_count--; + c_count--; + if (IsOper(cptr)) + o_count--; + } checklist(); if (cptr->prev) cptr->prev->next = cptr->next; diff -c -N -r irc2.8.21+CSr19/ircd/s_auth.c irc2.8.21+CSr20/ircd/s_auth.c *** irc2.8.21+CSr19/ircd/s_auth.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/s_auth.c Sun Jan 21 00:17:52 1996 *************** *** 88,94 **** --- 88,99 ---- sock.sin_family = AF_INET; if (connect(cptr->authfd, (struct sockaddr *)&sock, + #ifdef DGUX + sizeof(sock)) == -1 && (errno != EINPROGRESS) && + (errno != EAGAIN)) + #else sizeof(sock)) == -1 && errno != EINPROGRESS) + #endif { ircstp->is_abad++; /* diff -c -N -r irc2.8.21+CSr19/ircd/s_bsd.c irc2.8.21+CSr20/ircd/s_bsd.c *** irc2.8.21+CSr19/ircd/s_bsd.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/s_bsd.c Sun Jan 21 11:10:51 1996 *************** *** 253,259 **** } else if (cptr->fd >= MAXCLIENTS) { ! sendto_ops("No more connections allowed (%s)", cptr->name); (void)close(cptr->fd); return -1; } --- 253,259 ---- } else if (cptr->fd >= MAXCLIENTS) { ! sendto_flagops(6,"No more connections allowed (%s)", cptr->name); (void)close(cptr->fd); return -1; } *************** *** 371,377 **** } else if (cptr->fd >= MAXCLIENTS) { ! sendto_ops("No more connections allowed (%s)", cptr->name); (void)close(cptr->fd); return -1; } --- 371,377 ---- } else if (cptr->fd >= MAXCLIENTS) { ! sendto_flagops(6,"No more connections allowed (%s)", cptr->name); (void)close(cptr->fd); return -1; } *************** *** 1894,1900 **** set_non_blocking(cptr->fd, cptr); set_sock_opts(cptr->fd, cptr); (void)signal(SIGALRM, dummy); ! if (connect(cptr->fd, svp, len) < 0 && errno != EINPROGRESS) { errtmp = errno; /* other system calls may eat errno */ report_error("Connect to host %s failed: %s",cptr); --- 1894,1905 ---- set_non_blocking(cptr->fd, cptr); set_sock_opts(cptr->fd, cptr); (void)signal(SIGALRM, dummy); ! if (connect(cptr->fd, svp, len) < 0 && ! #ifdef DGUX ! (errno != EINPROGRESS) && (errno != EAGAIN)) ! #else ! (errno != EINPROGRESS)) ! #endif { errtmp = errno; /* other system calls may eat errno */ report_error("Connect to host %s failed: %s",cptr); diff -c -N -r irc2.8.21+CSr19/ircd/s_conf.c irc2.8.21+CSr20/ircd/s_conf.c *** irc2.8.21+CSr19/ircd/s_conf.c Fri Jan 5 17:02:16 1996 --- irc2.8.21+CSr20/ircd/s_conf.c Sun Jan 21 00:02:14 1996 *************** *** 73,81 **** #include "comstud.h" - #if defined(USE_DICH_CONF) || defined(B_LINES) || defined(E_LINES) #include "dich_conf.h" - #endif /* USE_DICH_CONF || B_LINES || E_LINES */ static int check_time_interval PROTO((char *, char *)); static int lookup_confhost PROTO((aConfItem *)); --- 73,79 ---- *************** *** 628,647 **** if (sig != 2) flush_cache(); ! #ifdef USE_DICH_CONF ! clear_conf_list(&KList1); ! clear_conf_list(&KList2); ! clear_conf_list(&KList3); ! #endif /* USE_DICH_CONF */ #ifdef B_LINES ! clear_conf_list(&BList1); ! clear_conf_list(&BList2); ! clear_conf_list(&BList3); #endif /* B_LINES */ #ifdef E_LINES ! clear_conf_list(&EList1); ! clear_conf_list(&EList2); ! clear_conf_list(&EList3); #endif /* E_LINES */ (void) initconf(0); close_listeners(); --- 626,643 ---- if (sig != 2) flush_cache(); ! clear_conf_list(&KList1, 1); ! clear_conf_list(&KList2, 1); ! clear_conf_list(&KList3, 1); #ifdef B_LINES ! clear_conf_list(&BList1, 1); ! clear_conf_list(&BList2, 1); ! clear_conf_list(&BList3, 1); #endif /* B_LINES */ #ifdef E_LINES ! clear_conf_list(&EList1, 1); ! clear_conf_list(&EList2, 1); ! clear_conf_list(&EList3, 1); #endif /* E_LINES */ (void) initconf(0); close_listeners(); *************** *** 993,999 **** portnum = aconf->port; } - #ifdef USE_DICH_CONF if ((aconf->status & CONF_KILL) && aconf->host) { char *host = host_field(aconf); --- 989,994 ---- *************** *** 1014,1020 **** MyFree(host); } - #endif /* USE_DICH_CONF */ #ifdef B_LINES if (aconf->host && (aconf->status & CONF_BOT_IGNORE)) { --- 1009,1014 ---- *************** *** 1145,1154 **** { char reply[256], *host, *name; aConfItem *tmp; - #ifdef USE_DICH_CONF char *rev; aConfList *list; - #endif /* USE_DICH_CONF */ #ifdef E_LINES if (find_eline(cptr)) --- 1139,1146 ---- *************** *** 1167,1173 **** reply[0] = '\0'; - #ifdef USE_DICH_CONF rev = (char *) MyMalloc(strlen(host)+1); reverse(rev, host); --- 1159,1164 ---- *************** *** 1224,1257 **** matched: MyFree(rev); - - # ifdef DICH_CONF_DEBUG - if (reply[0] || tmp) - sendto_ops("%s matched line : K:%s:%s:%s:%d:%d", - get_client_name(cptr, FALSE), - tmp->host ? tmp->host : "", - tmp->passwd ? tmp->passwd : "", - tmp->name ? tmp->name : "", - tmp->port, get_conf_class(tmp)); - # endif /* DICH_CONF_DEBUG */ - - #endif /* USE_DICH_CONF */ - - #if !defined(USE_DICH_CONF) || defined(DICH_CONF_DEBUG) - for (tmp = conf; tmp; tmp = tmp->next) - if ((tmp->status == CONF_KILL) && tmp->host && tmp->name && - (match(tmp->host, host) == 0) && - (!name || match(tmp->name, name) == 0) && - (!tmp->port || (tmp->port == cptr->acpt->port))) - { - if (BadPtr(tmp->passwd)) - break; - if (is_comment(tmp->passwd)) - break; - if (check_time_interval(tmp->passwd, reply)) - break; - } - #endif /* !USE_DICH_CONF || DICH_CONF_DEBUG */ if (reply[0]) sendto_one(cptr, reply, me.name, ERR_YOUREBANNEDCREEP, cptr->name); --- 1215,1220 ---- diff -c -N -r irc2.8.21+CSr19/ircd/s_debug.c irc2.8.21+CSr20/ircd/s_debug.c *** irc2.8.21+CSr19/ircd/s_debug.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/s_debug.c Sun Jan 21 11:47:09 1996 *************** *** 138,151 **** #ifdef IDENTD_ONLY 'd', #endif - #ifdef DBUF_TAIL - 'D', - #endif #ifdef HIGHEST_CONNECTON 'h', - #endif - #ifdef DOUGH_HASH - 'H', #endif #ifdef REJECT_IPHONE 'i', --- 138,145 ---- diff -c -N -r irc2.8.21+CSr19/ircd/s_misc.c irc2.8.21+CSr20/ircd/s_misc.c *** irc2.8.21+CSr19/ircd/s_misc.c Fri Jan 5 17:02:15 1996 --- irc2.8.21+CSr20/ircd/s_misc.c Sat Jan 20 18:06:43 1996 *************** *** 347,352 **** --- 347,358 ---- if (MyConnect(sptr)) { + if (IsClient(sptr)) + m_clients--; + if (IsInvisible(sptr)) + m_invis--; + if (IsServer(sptr)) + m_servers--; #ifdef DOG3 if(IsServer(sptr)) delfrom_fdlist(sptr->fd,&serv_fdlist); diff -c -N -r irc2.8.21+CSr19/ircd/s_serv.c irc2.8.21+CSr20/ircd/s_serv.c *** irc2.8.21+CSr19/ircd/s_serv.c Fri Jan 5 17:19:30 1996 --- irc2.8.21+CSr20/ircd/s_serv.c Sun Jan 21 11:36:44 1996 *************** *** 41,49 **** #include #include "h.h" - #if defined(USE_DICH_CONF) || defined(B_LINES) || defined(E_LINES) #include "dich_conf.h" - #endif #ifdef DOG3 extern time_t check_fdlists(); --- 41,47 ---- *************** *** 55,60 **** --- 53,128 ---- int max_connection_count = 1, max_client_count = 1; #endif + #ifdef HIGHEST_CONNECTION + void + check_max_count() + { + if (m_clients > max_client_count) + max_client_count = m_clients; + if ((m_clients + m_servers) > max_connection_count) + { + max_connection_count = m_clients + m_servers; + if (max_connection_count % 10 == 0) + sendto_flagops(1, + "New highest connections: %d (%d clients)", + max_connection_count, max_client_count); + } + } + #endif /* HIGHEST_CONNECTION */ + + /* These can be static once we take check out of ircd.c */ + int s_ct, c_ct, u_ct, i_ct; + int o_ct, m_cs, m_is, m_ss; + + void + compute_lusers(mask) + char *mask; + { + aClient *acptr; + + c_ct = i_ct = s_ct = o_ct = 0; + m_cs = m_is = m_ss = u_ct = 0; + + for (acptr = client; acptr; acptr = acptr->next) + { + if (mask) + { + if (!IsServer(acptr) && acptr->user) + { + if (match(mask, acptr->user->server)) + continue; + } + else if (match(mask, acptr->name)) + continue; + } + switch (acptr->status) + { + case STAT_SERVER: + if (MyConnect(acptr)) + m_ss++; + case STAT_ME: + s_ct++; + break; + case STAT_CLIENT: + c_ct++; + if (MyConnect(acptr)) + m_cs++; + if (IsOper(acptr)) + o_ct++; + if (IsInvisible(acptr)) + { + i_ct++; + if (MyConnect(acptr)) + m_is++; + } + break; + default: + u_ct++; + break; + } + } + } + extern ts_val timedelta; /* *************** *** 135,141 **** return 0; } temp = atoi(parv[1]); ! if (temp && (temp <= 0)) { sendto_one(sptr, ":%s NOTICE %s :Hello??? Try a number > 0.", me.name, parv[0]); --- 203,209 ---- return 0; } temp = atoi(parv[1]); ! if (temp <= 0) { sendto_one(sptr, ":%s NOTICE %s :Hello??? Try a number > 0.", me.name, parv[0]); *************** *** 168,174 **** return 0; } temp = atoi(parv[1]); ! if (temp && (temp < 0)) { sendto_one(sptr, ":%s NOTICE %s :Hello??? Try a number >= 0.", me.name, parv[0]); --- 236,242 ---- return 0; } temp = atoi(parv[1]); ! if (temp < 0) { sendto_one(sptr, ":%s NOTICE %s :Hello??? Try a number >= 0.", me.name, parv[0]); *************** *** 558,563 **** --- 626,632 ---- strncpyzt(acptr->info, info, sizeof(acptr->info)); strncpyzt(acptr->serv->up, parv[0], sizeof(acptr->serv->up)); SetServer(acptr); + s_count++; add_client_to_list(acptr); (void)add_to_client_hash_table(acptr->name, acptr); /* *************** *** 657,663 **** inpath = get_client_name(cptr,TRUE); /* "refresh" inpath with host */ split = mycmp(cptr->name, cptr->sockhost); host = cptr->name; ! if (!(aconf = find_conf(cptr->confs, host, CONF_NOCONNECT_SERVER))) { ircstp->is_ref++; --- 726,734 ---- inpath = get_client_name(cptr,TRUE); /* "refresh" inpath with host */ split = mycmp(cptr->name, cptr->sockhost); host = cptr->name; ! #ifdef HIGHEST_CONNECTION ! check_max_count(); ! #endif if (!(aconf = find_conf(cptr->confs, host, CONF_NOCONNECT_SERVER))) { ircstp->is_ref++; *************** *** 763,768 **** --- 834,841 ---- ** code is more neat this way... --msa */ SetServer(cptr); + m_servers++; + s_count++; #ifdef DOG3 /* adds to fdlist */ addto_fdlist(cptr->fd,&serv_fdlist); *************** *** 1297,1309 **** report_configured_links(sptr, CONF_CLIENT); break; case 'K' : case 'k' : - #ifdef USE_DICH_CONF report_conf_links(sptr, &KList1, RPL_STATSKLINE, 'K'); report_conf_links(sptr, &KList2, RPL_STATSKLINE, 'K'); report_conf_links(sptr, &KList3, RPL_STATSKLINE, 'K'); - #else - report_configured_links(sptr, CONF_KILL); - #endif break; case 'M' : case 'm' : for (mptr = msgtab; mptr->cmd; mptr++) --- 1370,1378 ---- *************** *** 1473,1480 **** int parc; char *parv[]; { - int s_count = 0, c_count = 0, u_count = 0, i_count = 0; - int o_count = 0, m_client = 0, m_server = 0; aClient *acptr; if (check_registered_user(sptr)) --- 1542,1547 ---- *************** *** 1484,1591 **** if(hunt_server(cptr, sptr, ":%s LUSERS %s :%s", 2, parc, parv) != HUNTED_ISME) return 0; ! #if defined(DOG3) && defined(RESTRICT) ! /* this is to reduce load while connecting */ ! if (lifesux && !IsAnOper(sptr)) { ! sendto_one(sptr,rpl_str(RPL_LOAD2HI),me.name,parv[0]); ! return 0; } ! #endif ! ! (void)collapse(parv[1]); ! for (acptr = client; acptr; acptr = acptr->next) ! { ! if (parc>1) ! if (!IsServer(acptr) && acptr->user) ! { ! if (match(parv[1], acptr->user->server)) ! continue; ! } ! else ! if (match(parv[1], acptr->name)) ! continue; ! ! switch (acptr->status) ! { ! case STAT_SERVER: ! if (MyConnect(acptr)) ! m_server++; ! case STAT_ME: ! s_count++; ! break; ! case STAT_CLIENT: ! if (IsOper(acptr)) ! o_count++; ! #ifdef SHOW_INVISIBLE_LUSERS ! if (MyConnect(acptr)) ! m_client++; ! if (!IsInvisible(acptr)) ! c_count++; ! else ! i_count++; ! #else ! if (MyConnect(acptr)) ! { ! if (IsInvisible(acptr)) ! { ! if (IsAnOper(sptr)) ! m_client++; ! } ! else ! m_client++; ! } ! if (!IsInvisible(acptr)) ! c_count++; ! else ! i_count++; ! #endif ! break; ! default: ! u_count++; ! break; ! } ! } #ifndef SHOW_INVISIBLE_LUSERS ! if (IsAnOper(sptr) && i_count) #endif sendto_one(sptr, rpl_str(RPL_LUSERCLIENT), me.name, parv[0], ! c_count, i_count, s_count); #ifndef SHOW_INVISIBLE_LUSERS else sendto_one(sptr, ":%s %d %s :There are %d users on %d servers", me.name, ! RPL_LUSERCLIENT, parv[0], c_count, s_count); #endif ! if (o_count) sendto_one(sptr, rpl_str(RPL_LUSEROP), ! me.name, parv[0], o_count); ! if (u_count > 0) sendto_one(sptr, rpl_str(RPL_LUSERUNKNOWN), ! me.name, parv[0], u_count); ! if ((c_count = count_channels(sptr))>0) sendto_one(sptr, rpl_str(RPL_LUSERCHANNELS), ! me.name, parv[0], count_channels(sptr)); sendto_one(sptr, rpl_str(RPL_LUSERME), ! me.name, parv[0], m_client, m_server); #ifdef HIGHEST_CONNECTION sendto_one(sptr, rpl_str(RPL_STATSCONN), me.name, parv[0], max_connection_count, max_client_count); ! if (m_client > max_client_count) ! max_client_count = m_client; ! if ((m_client + m_server) > max_connection_count) ! { ! max_connection_count = m_client + m_server; ! if (max_connection_count % 10 == 0) ! sendto_flagops(1, ! "New highest connections: %d (%d clients)", ! max_connection_count, max_client_count); ! } ! #endif return 0; ! } ! ! /*********************************************************************** * m_connect() - Added by Jto 11 Feb 1989 ***********************************************************************/ --- 1551,1601 ---- if(hunt_server(cptr, sptr, ":%s LUSERS %s :%s", 2, parc, parv) != HUNTED_ISME) return 0; ! if (parc > 1) { ! (void)collapse(parv[1]); ! compute_lusers(parv[1]); } ! else ! { ! s_ct = s_count; ! c_ct = c_count; ! i_ct = i_count; ! o_ct = o_count; ! m_cs = m_clients; ! m_ss = m_servers; ! u_ct = 0; ! } ! #ifndef SHOW_INVISIBLE_LUSERS ! if (IsAnOper(sptr) && i_ct) #endif sendto_one(sptr, rpl_str(RPL_LUSERCLIENT), me.name, parv[0], ! c_ct-i_ct, i_ct, s_ct); #ifndef SHOW_INVISIBLE_LUSERS else sendto_one(sptr, ":%s %d %s :There are %d users on %d servers", me.name, ! RPL_LUSERCLIENT, parv[0], c_ct-i_ct, s_ct); #endif ! if (o_ct) sendto_one(sptr, rpl_str(RPL_LUSEROP), ! me.name, parv[0], o_ct); ! if (u_ct > 0) sendto_one(sptr, rpl_str(RPL_LUSERUNKNOWN), ! me.name, parv[0], u_ct); ! if (ch_count > 0) sendto_one(sptr, rpl_str(RPL_LUSERCHANNELS), ! me.name, parv[0], ch_count); sendto_one(sptr, rpl_str(RPL_LUSERME), ! me.name, parv[0], m_cs, m_ss); #ifdef HIGHEST_CONNECTION sendto_one(sptr, rpl_str(RPL_STATSCONN), me.name, parv[0], max_connection_count, max_client_count); ! #endif return 0; ! } ! /*********************************************************************** * m_connect() - Added by Jto 11 Feb 1989 ***********************************************************************/ *************** *** 1986,1992 **** parv[0]); return 0; } - #ifdef USE_DICH_CONF aconf = make_conf(); aconf->status = CONF_KILL; DupString(aconf->host, host); --- 1996,2001 ---- *************** *** 2014,2023 **** } MyFree(host); } ! rehashed = 1; ! sendto_ops("%s added K-Line for [%s@%s]", parv[0], user, host); sendto_one(sptr, ":%s NOTICE %s :Added K-Line [%s@%s] to server configfile", me.name, parv[0], user, host); - #endif /* USE_DICH_CONF */ if ((out = open(configfile, O_WRONLY|O_APPEND))==-1) { sendto_one(sptr, ":%s NOTICE %s :Problem opening server configfile", me.name, parv[0]); --- 2023,2032 ---- } MyFree(host); } ! rehashed = 1; /* Forces looping thru clients to check k-lines */ ! sendto_flagops(1,"%s added K-Line for [%s@%s]: %s", parv[0], user, host, ! parv[2] && *parv[2] ? parv[2] : "No reason"); sendto_one(sptr, ":%s NOTICE %s :Added K-Line [%s@%s] to server configfile", me.name, parv[0], user, host); if ((out = open(configfile, O_WRONLY|O_APPEND))==-1) { sendto_one(sptr, ":%s NOTICE %s :Problem opening server configfile", me.name, parv[0]); *************** *** 2037,2055 **** (parv[2] && *parv[2]) ? "" : "", (parv[2] && *parv[2]) ? parv[2] : "", user); if (write(out, buffer, strlen(buffer)) <= 0) - { sendto_one(sptr, ":%s NOTICE %s :Problem writing to the configfile", me.name, parv[0]); - close(out); - return 0; - } close(out); - #ifdef USE_DICH_CONF return 0; - #else - sendto_ops("%s added K-Line for [%s@%s]", parv[0], user, host); - sendto_one(sptr, ":%s NOTICE %s :Added K-Line [%s@%s] to server configfile", me.name, parv[0], user, host); - return rehash(cptr, sptr, 0); - #endif } #endif /* QUOTE_KLINE */ --- 2046,2054 ---- diff -c -N -r irc2.8.21+CSr19/ircd/s_user.c irc2.8.21+CSr20/ircd/s_user.c *** irc2.8.21+CSr19/ircd/s_user.c Fri Jan 5 17:02:16 1996 --- irc2.8.21+CSr20/ircd/s_user.c Sun Jan 21 15:20:55 1996 *************** *** 57,64 **** FLAGS_SERVNOTICE, 's', #ifdef FK_USERMODES FLAGS_FMODE, 'f', - #endif FLAGS_UMODE, 'u', #ifdef CLIENT_NOTICES FLAGS_CMODE, 'c', #endif --- 57,64 ---- FLAGS_SERVNOTICE, 's', #ifdef FK_USERMODES FLAGS_FMODE, 'f', FLAGS_UMODE, 'u', + #endif #ifdef CLIENT_NOTICES FLAGS_CMODE, 'c', #endif *************** *** 388,393 **** --- 388,394 ---- parv[0] = sptr->name; parv[1] = parv[2] = NULL; + if (MyConnect(sptr)) { if (!strcmp(user->host, "null")) *************** *** 406,412 **** strncpyzt(user->username, temp, USERLEN+1); if ((i = check_client(sptr, temp))) { ! sendto_ops("%s from %s.", i == -3 ? "Too many connections" : "Unauthorized connection", get_client_host(sptr)); --- 407,413 ---- strncpyzt(user->username, temp, USERLEN+1); if ((i = check_client(sptr, temp))) { ! sendto_flagops(6,"%s from %s.", i == -3 ? "Too many connections" : "Unauthorized connection", get_client_host(sptr)); *************** *** 622,629 **** --- 623,635 ---- else strncpyzt(user->username, username, USERLEN+1); SetClient(sptr); + c_count++; if (MyConnect(sptr)) { + m_clients++; + #ifdef HIGHEST_CONNECTION + check_max_count(); + #endif sendto_one(sptr, rpl_str(RPL_WELCOME), me.name, nick, nick); /* This is a duplicate of the NOTICE but see below...*/ sendto_one(sptr, rpl_str(RPL_YOURHOST), me.name, nick, *************** *** 790,796 **** ** there is no danger of the server being disconnected. ** Ultimate way to jupiter a nick ? >;-). -avalon */ ! sendto_ops("Nick collision on %s(%s <- %s)", sptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; --- 796,802 ---- ** there is no danger of the server being disconnected. ** Ultimate way to jupiter a nick ? >;-). -avalon */ ! sendto_flagops(4,"Nick collision on %s(%s <- %s)", sptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; *************** *** 886,892 **** if (!doests || !newts || !acptr->tsinfo || (newts == acptr->tsinfo)) { ! sendto_ops("Nick collision on %s(%s <- %s)(both killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; --- 892,898 ---- if (!doests || !newts || !acptr->tsinfo || (newts == acptr->tsinfo)) { ! sendto_flagops(4,"Nick collision on %s(%s <- %s)(both killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; *************** *** 910,920 **** else { if (sameuser) ! sendto_ops("Nick collision on %s(%s <- %s)(older killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); else ! sendto_ops("Nick collision on %s(%s <- %s)(newer killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); --- 916,926 ---- else { if (sameuser) ! sendto_flagops(4,"Nick collision on %s(%s <- %s)(older killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); else ! sendto_flagops(4,"Nick collision on %s(%s <- %s)(newer killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); *************** *** 942,948 **** mycmp(acptr->user->host, acptr->user->host) == 0; if (!doests || !newts || !acptr->tsinfo || (newts == acptr->tsinfo)) { ! sendto_ops("Nick change collision from %s to %s(%s <- %s)(both killed)", sptr->name, acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; --- 948,954 ---- mycmp(acptr->user->host, acptr->user->host) == 0; if (!doests || !newts || !acptr->tsinfo || (newts == acptr->tsinfo)) { ! sendto_flagops(4,"Nick change collision from %s to %s(%s <- %s)(both killed)", sptr->name, acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; *************** *** 966,976 **** (!sameuser && newts > acptr->tsinfo)) { if (sameuser) ! sendto_ops("Nick change collision from %s to %s(%s <- %s)(older killed)", sptr->name, acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); else ! sendto_ops("Nick change collision from %s to %s(%s <- %s)(newer killed)", sptr->name, acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; --- 972,982 ---- (!sameuser && newts > acptr->tsinfo)) { if (sameuser) ! sendto_flagops(4,"Nick change collision from %s to %s(%s <- %s)(older killed)", sptr->name, acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); else ! sendto_flagops(4,"Nick change collision from %s to %s(%s <- %s)(newer killed)", sptr->name, acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; *************** *** 987,997 **** else { if (sameuser) ! sendto_ops("Nick collision on %s(%s <- %s)(older killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); else ! sendto_ops("Nick collision on %s(%s <- %s)(newer killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); --- 993,1003 ---- else { if (sameuser) ! sendto_flagops(4,"Nick collision on %s(%s <- %s)(older killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); else ! sendto_flagops(4,"Nick collision on %s(%s <- %s)(newer killed)", acptr->name, acptr->from->name, get_client_name(cptr, FALSE)); *************** *** 1038,1043 **** --- 1044,1053 ---- for (s = user_modes; (flag = *s); s += 2) if (*m == *(s+1)) { + if (flag == FLAGS_INVISIBLE) + i_count++; + if (flag == FLAGS_OPER) + o_count++; sptr->flags |= flag&SEND_UMODES; break; } *************** *** 1747,1752 **** --- 1757,1764 ---- } #ifndef NO_DEFAULT_INVISIBLE sptr->flags |= FLAGS_INVISIBLE; + i_count++; + m_invis++; #endif sptr->flags |= (UFLAGS & atoi(host)); strncpyzt(user->host, host, sizeof(user->host)); *************** *** 1912,1928 **** return 0; } - #ifdef FK_USERMODES if (strchr(parv[0], '.')) sendto_flagops(4,"Received KILL message for %s. From %s Path: %s!%s", acptr->name, parv[0], inpath, path); else sendto_flagops(3,"Received KILL message for %s. From %s Path: %s!%s", acptr->name, parv[0], inpath, path); - #else - sendto_ops("Received KILL message for %s. From %s Path: %s!%s", - acptr->name, parv[0], inpath, path); - #endif #if defined(USE_SYSLOG) && defined(SYSLOG_KILL) if (IsOper(sptr)) --- 1924,1935 ---- *************** *** 2240,2246 **** --- 2247,2256 ---- #endif SetLocOp(sptr); else + { SetOper(sptr); + o_count++; + } *--s = '@'; sendto_ops("%s (%s@%s) is now operator (%c)", parv[0], sptr->user->username, sptr->user->host, *************** *** 2618,2623 **** --- 2628,2649 ---- if ((setflags & (FLAGS_OPER|FLAGS_LOCOP)) && !IsAnOper(sptr) && MyConnect(sptr)) det_confs_butmask(sptr, CONF_CLIENT & ~CONF_OPS); + if (!(setflags & FLAGS_OPER) && IsOper(sptr)) + o_count++; + if ((setflags & FLAGS_OPER) && !IsOper(sptr)) + o_count--; + if (!(setflags & FLAGS_INVISIBLE) && IsInvisible(sptr)) + { + if (MyConnect(sptr)) + m_invis++; + i_count++; + } + if ((setflags & FLAGS_INVISIBLE) && !IsInvisible(sptr)) + { + if (MyConnect(sptr)) + m_invis--; + i_count--; + } #ifdef USE_SERVICES if (IsOper(sptr) && !(setflags & FLAGS_OPER)) check_services_butone(SERVICE_WANT_OPER, sptr,