mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-20 12:44:47 -04:00
Quit the proxy when reading zero or less from stdin
This commit is contained in:
parent
8db604e787
commit
1d80bddde3
5 changed files with 31 additions and 12 deletions
|
@ -114,10 +114,10 @@ void NativeMessagingHost::readLength()
|
|||
}
|
||||
}
|
||||
|
||||
void NativeMessagingHost::readStdIn(const quint32 length)
|
||||
bool NativeMessagingHost::readStdIn(const quint32 length)
|
||||
{
|
||||
if (length <= 0) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray arr;
|
||||
|
@ -129,7 +129,7 @@ void NativeMessagingHost::readStdIn(const quint32 length)
|
|||
int c = std::getchar();
|
||||
if (c == EOF) {
|
||||
// message ended prematurely, ignore it and return
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
arr.append(static_cast<char>(c));
|
||||
}
|
||||
|
@ -137,6 +137,7 @@ void NativeMessagingHost::readStdIn(const quint32 length)
|
|||
if (arr.length() > 0) {
|
||||
sendReply(m_browserClients.readResponse(arr));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void NativeMessagingHost::newLocalConnection()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue