mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-20 12:44:47 -04:00
Socket buffer size fix (#1720)
This commit is contained in:
parent
0650b3084e
commit
3a92e4aab9
5 changed files with 24 additions and 5 deletions
|
@ -142,11 +142,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, &max, sizeof(max));
|
||||
}
|
||||
|
||||
QByteArray arr = socket->readAll();
|
||||
if (arr.isEmpty()) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue