summaryrefslogtreecommitdiff
path: root/src/resolver.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-03-10 14:38:34 +0000
committerChristian Pointner <equinox@anytun.org>2009-03-10 14:38:34 +0000
commit591078f9c90100b1f6926bdac55877aa864f2238 (patch)
tree1f75aa9a53896e938a9c0ca8fe1021ab04e19625 /src/resolver.cpp
parentchanged packetSource to use gResolver (diff)
added SIGERROR to signal Controller
Diffstat (limited to 'src/resolver.cpp')
-rw-r--r--src/resolver.cpp9
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_));