From: Gabriel B. <sh...@us...> - 2007-04-10 15:57:01
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26950/src Modified Files: glines.c ircd.c klines.c m_rwho.c m_stats.c memcount.c Log Message: Bahamut 1.8.4 latest changes part 2, this is not complete yet. Index: memcount.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/memcount.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** memcount.c 9 Jul 2005 03:09:11 -0000 1.4 --- memcount.c 10 Apr 2007 15:56:56 -0000 1.5 *************** *** 73,76 **** --- 73,78 ---- MCircd mc_ircd = {0}; MClist mc_list = {0}; + MCklines mc_klines = {0}; + MCglines mc_glines = {0}; MCm_services mc_m_services = {0}; MCmodules mc_modules = {0}; *************** *** 136,139 **** --- 138,143 ---- TracedCount tc_hash = {0}; TracedCount tc_hide = {0}; + TracedCount tc_klines = {0}; + TracedCount tc_glines = {0}; TracedCount tc_list = {0}; TracedCount tc_m_services = {0}; *************** *** 173,176 **** --- 177,182 ---- alloc_total += memcount_hide(&mc_hide); alloc_total += memcount_ircd(&mc_ircd); + alloc_total += memcount_klines(&mc_klines); + alloc_total += memcount_glines(&mc_glines); alloc_total += memcount_list(&mc_list); alloc_total += memcount_m_services(&mc_m_services); *************** *** 1360,1363 **** --- 1366,1371 ---- /* grouped: m_services.c s_conf.c s_serv.c userban.c */ /* yeah, this is screwy... */ + traced_total += memtrace_count(&tc_klines, mc_klines.file); + traced_total += memtrace_count(&tc_glines, mc_glines.file); traced_total += memtrace_count(&tc_m_services, mc_m_services.file); traced_total += memtrace_count(&tc_s_conf, mc_s_conf.file); *************** *** 1371,1374 **** --- 1379,1384 ---- subtotal -= mc_s_conf.ports.c * sizeof(aPort); subtotal -= mc_s_conf.classes.c * sizeof(aClass); + traced_subtotal = tc_klines.allocated.m; + traced_subtotal = tc_glines.allocated.m; traced_subtotal = tc_m_services.allocated.m; traced_subtotal += tc_s_conf.allocated.m; *************** *** 1381,1384 **** --- 1391,1396 ---- if (detail) { + memtrace_report(cptr, mc_klines.file); + memtrace_report(cptr, mc_glines.file); memtrace_report(cptr, mc_m_services.file); memtrace_report(cptr, mc_s_conf.file); *************** *** 1411,1414 **** --- 1423,1428 ---- subtotal += tc_hash.management.m; subtotal += tc_hide.management.m; + subtotal += tc_klines.management.m; + subtotal += tc_glines.management.m; subtotal += tc_list.management.m; subtotal += tc_m_services.management.m; Index: m_stats.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_stats.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** m_stats.c 12 Mar 2006 19:47:50 -0000 1.6 --- m_stats.c 10 Apr 2007 15:56:56 -0000 1.7 *************** *** 364,368 **** sp = &tmp; memcpy((char *) sp, (char *) ircstp, sizeof(*sp)); ! for (i = 0; i < highest_fd; i++) { if (!(acptr = local[i])) --- 364,368 ---- sp = &tmp; memcpy((char *) sp, (char *) ircstp, sizeof(*sp)); ! for (i = 0; i <= highest_fd; i++) { if (!(acptr = local[i])) Index: m_rwho.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_rwho.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** m_rwho.c 27 Jun 2005 03:02:28 -0000 1.1.1.1 --- m_rwho.c 10 Apr 2007 15:56:56 -0000 1.2 *************** *** 68,74 **** #define RWM_GPROB 0x2000 ! /* whois compatibility */ ! #define RWC_SHOWIP 0x0001 ! #define RWC_CHANNEL 0x0002 /* output options */ --- 68,72 ---- #define RWM_GPROB 0x2000 ! /* output options */ *************** *** 91,94 **** --- 89,100 ---- + + /* miscellaneous flags */ + #define RWC_SHOWIP 0x0001 /* WHO compatibility */ + #define RWC_CHANNEL 0x0002 /* WHO compatibility */ + #define RWC_TIME 0x0004 /* show timing stats */ + + + static const char *rwho_help[] = { "RWHO <[+|-]matchflags>[/<outputflags>[:<cookie>]] <args>", *************** *** 112,117 **** " t <seconds> - nick has been in use for N or more (less) seconds", " T <type> - user is (not) type <type> as set by services", ! " C - for compatibility with WHO, use discouraged", ! " I - for compatibility with WHO, use discouraged", "The following match flags are compiled into a single regular expression", "in the order you specify, so later flags can use backreferences to", --- 118,123 ---- " t <seconds> - nick has been in use for N or more (less) seconds", " T <type> - user is (not) type <type> as set by services", ! " C - for compatibility with WHO", ! " I - for compatibility with WHO", "The following match flags are compiled into a single regular expression", "in the order you specify, so later flags can use backreferences to", *************** *** 151,154 **** --- 157,162 ---- " D - returns only one matching result per host (summarize)", #endif + " $ - show time taken for search", + NULL }; *************** *** 157,161 **** unsigned check[2]; /* things to try match */ unsigned rplfields; /* fields to include in the response */ ! unsigned compat; /* WHO compatibility flags */ char *rplcookie; /* response cookie */ int countonly; /* counting only, no results */ --- 165,169 ---- unsigned check[2]; /* things to try match */ unsigned rplfields; /* fields to include in the response */ ! unsigned misc; /* miscellaneous flags */ char *rplcookie; /* response cookie */ int countonly; /* counting only, no results */ *************** *** 379,383 **** case 'C': ! rwho_opts.compat |= RWC_CHANNEL; break; --- 387,391 ---- case 'C': ! rwho_opts.misc |= RWC_CHANNEL; break; *************** *** 467,471 **** case 'I': ! rwho_opts.compat |= RWC_SHOWIP; break; --- 475,479 ---- case 'I': ! rwho_opts.misc |= RWC_SHOWIP; break; *************** *** 769,774 **** case 'g': rwho_opts.rplfields |= RWO_GCOS; sfl++; break; case 'a': rwho_opts.rplfields |= RWO_AWAY; sfl++; break; - case 'C': rwho_opts.countonly = 1; sfl++; break; case 'L': --- 777,783 ---- case 'g': rwho_opts.rplfields |= RWO_GCOS; sfl++; break; case 'a': rwho_opts.rplfields |= RWO_AWAY; sfl++; break; case 'C': rwho_opts.countonly = 1; sfl++; break; + case '$': rwho_opts.misc |= RWC_TIME; sfl++; break; + case 'L': *************** *** 1055,1059 **** char chname[CHANNELLEN+2] = "*"; ! if (!cm && (rwho_opts.compat & RWC_CHANNEL) && chptr) { for (cm = chptr->members; cm; cm = cm->next) --- 1064,1068 ---- char chname[CHANNELLEN+2] = "*"; ! if (!cm && (rwho_opts.misc & RWC_CHANNEL) && chptr) { for (cm = chptr->members; cm; cm = cm->next) *************** *** 1082,1086 **** *dst = 0; ! if (!rwho_opts.chptr && (rwho_opts.compat & RWC_CHANNEL) && chptr) { dst = chname; --- 1091,1095 ---- *dst = 0; ! if (!rwho_opts.chptr && (rwho_opts.misc & RWC_CHANNEL) && chptr) { dst = chname; *************** *** 1091,1095 **** } ! if (rwho_opts.compat & RWC_SHOWIP) src = ac->hostip; else --- 1100,1104 ---- } ! if (rwho_opts.misc & RWC_SHOWIP) src = ac->hostip; else *************** *** 1450,1477 **** } ! if (rwho_opts.compat) sendto_one(sptr, getreply(RPL_COMMANDSYNTAX), me.name, sptr->name, ! "NOTE: match flags C and I are deprecated"); ! ! cend = clock(); ! ircsprintf(rwhobuf, "Search completed in %.03fs.", ! ((double)(cend - cbegin)) / CLOCKS_PER_SEC); ! sendto_one(sptr, getreply(RPL_COMMANDSYNTAX), me.name, sptr->name,rwhobuf); ! ! ircsprintf(rwhobuf, "%d", results); sendto_one(sptr, getreply(RPL_ENDOFWHO), me.name, parv[0], rwhobuf,"RWHO"); if (failcode) { ! sendto_one(sptr, ":%s NOTICE %s :RWHO: Internal error %d during " ! "match, notify coders!", me.name, parv[0], failcode); ! sendto_one(sptr, ":%s NOTICE %s :RWHO: Match target was: %s %s " ! "[%s] [%s]", me.name, parv[0], failclient->name, ! failclient->user->username, failclient->info, ! failclient->user->away ? failclient->user->away : ""); } ! free(rwho_opts.re); ! return 0; } --- 1459,1498 ---- } ! cend = clock(); ! if (rwho_opts.misc & RWC_TIME) ! { ! ircsprintf(rwhobuf, "Search completed in %.03fs.", ! ((double)(cend - cbegin)) / CLOCKS_PER_SEC); sendto_one(sptr, getreply(RPL_COMMANDSYNTAX), me.name, sptr->name, ! rwhobuf); ! } ! ! if (rwho_opts.rplcookie) ! ircsprintf(rwhobuf, "%d:%s", results, rwho_opts.rplcookie); ! else ! ircsprintf(rwhobuf, "%d", results); sendto_one(sptr, getreply(RPL_ENDOFWHO), me.name, parv[0], rwhobuf,"RWHO"); if (failcode) { ! if (failcode == PCRE_ERROR_MATCHLIMIT) ! { ! sendto_one(sptr, ":%s NOTICE %s :RWHO: Regex match pattern is too " ! "recursive, so some matches failed prematurely. Use a " ! "more specific pattern.", me.name, parv[0]); ! } ! else ! { ! sendto_one(sptr, ":%s NOTICE %s :RWHO: Internal error %d during " ! "match, notify coders!", me.name, parv[0], failcode); ! sendto_one(sptr, ":%s NOTICE %s :RWHO: Match target was: %s %s " ! "[%s] [%s]", me.name, parv[0], failclient->name, ! failclient->user->username, failclient->info, ! failclient->user->away ? failclient->user->away : ""); ! } } ! free(rwho_opts.re); ! return 0; } |