From ea269948e4192f5907cc9cf7771db53ec804327d Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 10 May 2010 17:45:15 +0000 Subject: [PATCH] Add and use new config option "Listener" This is what each option does: Listen on ipv4 and ipv6: Listener, Listen6 Listen on ipv4 only: Listener4, Listen4, Listen Listen on ipv6 only: Listener6 Removed: ListenPort (not used since at least 0.047) (ZNC will only ever use Listener* by itself) This was done to preserve the old meaning of "Listen" and "Listen6", so that user configs don't break after update. Thanks to DarthGandalf for thinking about and implementing this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1977 726aef4b-f618-498e-8847-2d620e286838 --- znc.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/znc.cpp b/znc.cpp index 4ab9c9ac..fc6f6515 100644 --- a/znc.cpp +++ b/znc.cpp @@ -575,7 +575,7 @@ bool CZNC::WriteConfig() { break; } - m_LockFile.Write("Listen" + s6 + " = " + sAcceptProtocol + sHostPortion + + m_LockFile.Write("Listener" + s6 + " = " + sAcceptProtocol + sHostPortion + CString((pListener->IsSSL()) ? "+" : "") + CString(pListener->GetPort()) + "\n"); } @@ -695,7 +695,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { sListenHost += " "; } - vsLines.push_back("Listen" + s6 + " = " + sListenHost + sSSL + CString(uListenPort)); + vsLines.push_back("Listener" + s6 + " = " + sListenHost + sSSL + CString(uListenPort)); // !Listen set ssGlobalMods; @@ -1461,12 +1461,13 @@ bool CZNC::DoRehash(CString& sError) } } } else { - if (sName.Equals("Listen") || sName.Equals("ListenPort") || sName.Equals("Listen6") || sName.Equals("Listen4")) { + if (sName.Equals("Listen") || sName.Equals("Listen6") || sName.Equals("Listen4") + || sName.Equals("Listener") || sName.Equals("Listener6") || sName.Equals("Listener4")) { EAddrType eAddr = ADDR_ALL; - if (sName.Equals("Listen4")) { + if (sName.Equals("Listen4") || sName.Equals("Listen") || sName.Equals("Listener4")) { eAddr = ADDR_IPV4ONLY; } - if (sName.Equals("Listen6")) { + if (sName.Equals("Listener6")) { eAddr = ADDR_IPV6ONLY; }