From e5f71bb08526f2feeb514a4c9f569302be98e6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Wed, 21 Feb 2018 19:12:12 +0100 Subject: [PATCH] re-add special handling for TimeoutException --- Net/src/ICMPSocketImpl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Net/src/ICMPSocketImpl.cpp b/Net/src/ICMPSocketImpl.cpp index 21a8c51ec..8c68d5303 100644 --- a/Net/src/ICMPSocketImpl.cpp +++ b/Net/src/ICMPSocketImpl.cpp @@ -62,7 +62,7 @@ int ICMPSocketImpl::receiveFrom(void*, int, SocketAddress& address, int flags) Poco::Timestamp ts; do { - if (ts.isElapsed(_timeout)) + if (ts.isElapsed(_timeout)) { // This guards against a possible DoS attack, where sending // 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)); } + catch (TimeoutException&) + { + throw; + } catch (Exception&) { std::string err = _icmpPacket.errorDescription(buffer.begin(), maxPacketSize); - if (!err.empty()) + if (!err.empty()) throw ICMPException(err); - else + else throw; }