mirror of
https://github.com/znc/znc.git
synced 2026-07-04 00:41:38 +02:00
Rewrite znc.conf on SIGUSR1
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1666 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -41,7 +41,7 @@ CZNC::CZNC() {
|
||||
m_uBytesRead = 0;
|
||||
m_uBytesWritten = 0;
|
||||
m_pConnectUserTimer = NULL;
|
||||
m_bNeedRehash = false;
|
||||
m_eConfigState = ECONFIG_NOTHING;
|
||||
m_TimeStarted = time(NULL);
|
||||
}
|
||||
|
||||
@@ -228,8 +228,9 @@ void CZNC::Loop() {
|
||||
while (true) {
|
||||
CString sError;
|
||||
|
||||
if (GetNeedRehash()) {
|
||||
SetNeedRehash(false);
|
||||
switch (GetConfigState()) {
|
||||
case ECONFIG_NEED_REHASH:
|
||||
SetConfigState(ECONFIG_NOTHING);
|
||||
|
||||
if (RehashConfig(sError)) {
|
||||
Broadcast("Rehashing succeeded", true);
|
||||
@@ -237,6 +238,18 @@ void CZNC::Loop() {
|
||||
Broadcast("Rehashing failed: " + sError, true);
|
||||
Broadcast("ZNC is in some possibly inconsistent state!", true);
|
||||
}
|
||||
break;
|
||||
case ECONFIG_NEED_WRITE:
|
||||
SetConfigState(ECONFIG_NOTHING);
|
||||
|
||||
if (WriteConfig()) {
|
||||
Broadcast("Writing the config suceeded", true);
|
||||
} else {
|
||||
Broadcast("Writing the config file failed", true);
|
||||
}
|
||||
break;
|
||||
case ECONFIG_NOTHING:
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for users that need to be deleted
|
||||
|
||||
Reference in New Issue
Block a user