mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-20 12:44:47 -04:00
Merge branch 'master' into develop
Conflicts: src/CMakeLists.txt src/autotype/xcb/AutoTypeXCB.cpp src/browser/BrowserAction.cpp src/browser/BrowserService.cpp src/browser/BrowserService.h src/browser/BrowserSettings.h src/browser/NativeMessagingHost.cpp src/browser/NativeMessagingHost.h src/gui/EditWidgetIcons.cpp src/gui/EditWidgetIcons.h src/gui/MainWindow.cpp src/proxy/NativeMessagingHost.cpp tests/TestOpenSSHKey.cpp
This commit is contained in:
commit
aae6d09fd3
53 changed files with 9771 additions and 1125 deletions
|
@ -23,8 +23,12 @@
|
|||
#include <QtNetwork>
|
||||
#include <iostream>
|
||||
|
||||
NativeMessagingHost::NativeMessagingHost(DatabaseTabWidget* parent)
|
||||
: NativeMessagingBase()
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Winsock2.h>
|
||||
#endif
|
||||
|
||||
NativeMessagingHost::NativeMessagingHost(DatabaseTabWidget* parent, const bool enabled)
|
||||
: NativeMessagingBase(enabled)
|
||||
, m_mutex(QMutex::Recursive)
|
||||
, m_browserClients(m_browserService)
|
||||
, m_browserService(parent)
|
||||
|
@ -75,6 +79,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();
|
||||
}
|
||||
|
@ -144,11 +153,17 @@ void NativeMessagingHost::newLocalConnection()
|
|||
void NativeMessagingHost::newLocalMessage()
|
||||
{
|
||||
QLocalSocket* socket = qobject_cast<QLocalSocket*>(QObject::sender());
|
||||
|
||||
if (!socket || socket->bytesAvailable() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket->setReadBufferSize(NATIVE_MSG_MAX_LENGTH);
|
||||
int socketDesc = socket->socketDescriptor();
|
||||
if (socketDesc) {
|
||||
int max = NATIVE_MSG_MAX_LENGTH;
|
||||
setsockopt(socketDesc, SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&max), sizeof(max));
|
||||
}
|
||||
|
||||
QByteArray arr = socket->readAll();
|
||||
if (arr.isEmpty()) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue