Permalink
Browse files

Handle Listeners after SSLCertFile

Else, the Listeners will ignore the SSLCertFile config option.

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information...
1 parent ca36887 commit 3fa04f8c0a16ac95289acf046be873bff6c37197 @psychon psychon committed Apr 3, 2011
Showing with 17 additions and 16 deletions.
  1. +17 −16 znc.cpp
View
33 znc.cpp
@@ -1027,23 +1027,7 @@ bool CZNC::DoRehash(CString& sError)
MCString msModules; // Modules are queued for later loading
- const char *szListenerEntries[] = {
- "listen", "listen6", "listen4",
- "listener", "listener6", "listener4"
- };
- const size_t numListenerEntries = sizeof(szListenerEntries) / sizeof(szListenerEntries[0]);
VCString vsList;
-
- for (size_t i = 0; i < numListenerEntries; i++) {
- config.FindStringVector(szListenerEntries[i], vsList);
- VCString::const_iterator it = vsList.begin();
-
- for (; it != vsList.end(); ++it) {
- if (!AddListener(szListenerEntries[i] + CString(" ") + *it, sError))
- return false;
- }
- }
-
VCString::const_iterator vit;
config.FindStringVector("loadmodule", vsList);
for (vit = vsList.begin(); vit != vsList.end(); ++vit) {
@@ -1143,6 +1127,23 @@ bool CZNC::DoRehash(CString& sError)
if (config.FindStringEntry("maxbuffersize", sVal))
m_uiMaxBufferSize = sVal.ToUInt();
+ // This has to be after SSLCertFile is handled since it uses that value
+ const char *szListenerEntries[] = {
+ "listen", "listen6", "listen4",
+ "listener", "listener6", "listener4"
+ };
+ const size_t numListenerEntries = sizeof(szListenerEntries) / sizeof(szListenerEntries[0]);
+
+ for (size_t i = 0; i < numListenerEntries; i++) {
+ config.FindStringVector(szListenerEntries[i], vsList);
+ vit = vsList.begin();
+
+ for (; vit != vsList.end(); ++vit) {
+ if (!AddListener(szListenerEntries[i] + CString(" ") + *vit, sError))
+ return false;
+ }
+ }
+
CConfig::SubConfig subConf;
CConfig::SubConfig::const_iterator subIt;
config.FindSubConfig("user", subConf);

0 comments on commit 3fa04f8

Please sign in to comment.