diff options
author | Christian Pointner <equinox@anytun.org> | 2009-03-10 14:38:34 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-03-10 14:38:34 +0000 |
commit | 591078f9c90100b1f6926bdac55877aa864f2238 (patch) | |
tree | 1f75aa9a53896e938a9c0ca8fe1021ab04e19625 /src/resolver.cpp | |
parent | changed packetSource to use gResolver (diff) |
added SIGERROR to signal Controller
Diffstat (limited to 'src/resolver.cpp')
-rw-r--r-- | src/resolver.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/resolver.cpp b/src/resolver.cpp index 6d5c777..5e2d862 100644 --- a/src/resolver.cpp +++ b/src/resolver.cpp @@ -34,6 +34,7 @@ #include "resolver.h" #include "log.h" +#include "signalController.h" using ::boost::asio::ip::udp; using ::boost::asio::ip::tcp; @@ -68,7 +69,13 @@ template<class Proto> void ResolveHandler<Proto>::operator()(const boost::system::error_code& e, const boost::asio::ip::basic_resolver_iterator<Proto> endpointIt) { if(boost::system::posix_error::success == e) { - callback_(*endpointIt); + try { + callback_(*endpointIt); + } + catch(const std::runtime_error& e) + { + gSignalController.inject(SIGERROR, e.what()); + } } else { cLog.msg(Log::PRIO_ERROR) << "Error while resolving '" << addr_ << "' '" << port_ << "', retrying in 10 sec."; boost::thread(boost::bind(waitAndEnqueue<Proto>, 10, addr_, port_, callback_, resolv_addr_type_)); |