Merge pull request #11159 from DeterminateSystems/framedsource-terminate

~FramedSource(): Don't throw an exception if the remote has disconnected
This commit is contained in:
John Ericson 2024-07-23 09:19:39 -04:00 committed by GitHub
commit e20b0a5dda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -483,13 +483,17 @@ struct FramedSource : Source
~FramedSource()
{
if (!eof) {
while (true) {
auto n = readInt(from);
if (!n) break;
std::vector<char> data(n);
from(data.data(), n);
try {
if (!eof) {
while (true) {
auto n = readInt(from);
if (!n) break;
std::vector<char> data(n);
from(data.data(), n);
}
}
} catch (...) {
ignoreException();
}
}