From: esainane Date: Sat, 21 Nov 2015 08:38:11 +0000 (+1300) Subject: Fix OIdentdConfigGenerator double-printing on ssl X-Git-Tag: travis-deploy-test~546 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=refs%2Fpull%2F161%2Fhead Fix OIdentdConfigGenerator double-printing on ssl connected() is always connected to socketInitialized(). encrypted() is also connected to socketInitialized() when ssl is enabled. socketInitialized() fires socketOpen(...) unconditionally, but does not fire socketInitialized(...) if we're using SSL without encryption yet - see line 464. With socketOpen(...) connected to OIdentdConfigurationGenerator::addSocket, OIdentdConfigurationGenerator writes to .oidentd.conf twice for every connection. Changing this to have socketInitialized(...) connected instead prevents this duplication. --- diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 942e32f6..c42325f9 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -81,7 +81,7 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session) connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *))); if (Quassel::isOptionSet("oidentd")) { - connect(this, SIGNAL(socketOpen(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16)), Qt::BlockingQueuedConnection); + connect(this, SIGNAL(socketInitialized(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16)), Qt::BlockingQueuedConnection); connect(this, SIGNAL(socketDisconnected(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(removeSocket(const CoreIdentity*, QHostAddress, quint16, QHostAddress, quint16))); } }