Merge pull request #49863 from alekar/fix-osx-setsockopt-errors

Fix error on OS X regarding resetting timeouts.
This commit is contained in:
Alexey Milovidov 2023-05-20 01:55:41 +03:00 committed by GitHub
commit bd2f47591a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,13 +31,15 @@ TimeoutSetter::~TimeoutSetter()
{
try
{
bool connected = socket.impl()->initialized();
if (!connected)
return;
socket.setSendTimeout(old_send_timeout);
socket.setReceiveTimeout(old_receive_timeout);
}
catch (...)
{
/// Sometimes caught on Mac OS X. This message can be safely ignored.
/// If you are developer using Mac, please debug this error message by yourself.
tryLogCurrentException("Client", "TimeoutSetter: Can't reset timeouts");
}
}