Prevent proxy host from blocking application shutdown

* Fix #4079 - proxy host would get stuck trying to read characters from stdin. Switch to "readsome" which does not block if there are not enough characters to read. Added a longer delay to slow the checking loop down.
This commit is contained in:
Jonathan White 2020-01-10 22:31:56 -05:00 committed by Janek Bevendorff
parent 08a911466e
commit dc37537797

View File

@ -106,9 +106,9 @@ void NativeMessagingBase::readNativeMessages()
quint32 length = 0;
while (m_running.load() != 0 && !std::cin.eof()) {
length = 0;
std::cin.read(reinterpret_cast<char*>(&length), 4);
std::cin.readsome(reinterpret_cast<char*>(&length), 4);
readStdIn(length);
QThread::msleep(1);
QThread::msleep(100);
}
#endif
}