mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
re-add special handling for TimeoutException
This commit is contained in:
parent
de0f5a6b76
commit
e5f71bb085
@ -62,7 +62,7 @@ int ICMPSocketImpl::receiveFrom(void*, int, SocketAddress& address, int flags)
|
|||||||
Poco::Timestamp ts;
|
Poco::Timestamp ts;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (ts.isElapsed(_timeout))
|
if (ts.isElapsed(_timeout))
|
||||||
{
|
{
|
||||||
// This guards against a possible DoS attack, where sending
|
// This guards against a possible DoS attack, where sending
|
||||||
// fake ping responses will cause an endless loop.
|
// fake ping responses will cause an endless loop.
|
||||||
@ -72,12 +72,16 @@ int ICMPSocketImpl::receiveFrom(void*, int, SocketAddress& address, int flags)
|
|||||||
}
|
}
|
||||||
while (!_icmpPacket.validReplyID(buffer.begin(), maxPacketSize));
|
while (!_icmpPacket.validReplyID(buffer.begin(), maxPacketSize));
|
||||||
}
|
}
|
||||||
|
catch (TimeoutException&)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
catch (Exception&)
|
catch (Exception&)
|
||||||
{
|
{
|
||||||
std::string err = _icmpPacket.errorDescription(buffer.begin(), maxPacketSize);
|
std::string err = _icmpPacket.errorDescription(buffer.begin(), maxPacketSize);
|
||||||
if (!err.empty())
|
if (!err.empty())
|
||||||
throw ICMPException(err);
|
throw ICMPException(err);
|
||||||
else
|
else
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user