diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/cmd_stats.cpp | 8 | ||||
-rw-r--r-- | src/configreader.cpp | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp index 03c48609f..1296bf08a 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -227,6 +227,14 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str snprintf(percent, 30, "%03.5f%%", per); results.push_back(sn+" 249 "+user->nick+" :CPU Usage: "+percent); } +#else + PROCESS_MEMORY_COUNTERS MemCounters; + if (GetProcessMemoryInfo(GetCurrentProcess(), &MemCounters, sizeof(MemCounters))) + { + results.push_back(sn+" 249 "+user->nick+" :Total allocation: "+ConvToStr((MemCounters.WorkingSetSize + MemCounters.PagefileUsage) / 1024)+"K"); + results.push_back(sn+" 249 "+user->nick+" :Pagefile usage: "+ConvToStr(MemCounters.PagefileUsage / 1024)+"K"); + results.push_back(sn+" 249 "+user->nick+" :Page faults: "+ConvToStr(MemCounters.PageFaultCount)); + } #endif } break; diff --git a/src/configreader.cpp b/src/configreader.cpp index ad0e972f9..c492f6934 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1302,12 +1302,14 @@ void ServerConfig::Read(bool bail, User* user) } - /** Note: This is safe, the method checks for user == NULL */ - ServerInstance->Threads->Mutex(true); - ServerInstance->Parser->SetupCommandTable(user); - ServerInstance->Threads->Mutex(false); - - if (!bail) + if (bail) + { + /** Note: This is safe, the method checks for user == NULL */ + ServerInstance->Threads->Mutex(true); + ServerInstance->Parser->SetupCommandTable(user); + ServerInstance->Threads->Mutex(false); + } + else { if (user) user->WriteServ("NOTICE %s :*** Successfully rehashed server.", user->nick.c_str()); |