Disable STDIN listening when not needed

This commit is contained in:
varjolintu 2018-04-29 09:24:57 +03:00 committed by Jonathan White
parent 13a313ff66
commit 9d7e7c1ca8
6 changed files with 16 additions and 9 deletions

View file

@ -27,8 +27,8 @@
#include <Winsock2.h>
#endif
NativeMessagingHost::NativeMessagingHost(DatabaseTabWidget* parent) :
NativeMessagingBase(),
NativeMessagingHost::NativeMessagingHost(DatabaseTabWidget* parent, const bool enabled) :
NativeMessagingBase(enabled),
m_mutex(QMutex::Recursive),
m_browserClients(m_browserService),
m_browserService(parent)
@ -77,6 +77,11 @@ void NativeMessagingHost::run()
QString serverPath = getLocalServerPath();
QFile::remove(serverPath);
// Ensure that STDIN is not being listened when proxy is used
if (m_notifier->isEnabled()) {
m_notifier->setEnabled(false);
}
if (m_localServer->isListening()) {
m_localServer->close();
}