summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-03-22 17:50:10 +0000
committerChristian Pointner <equinox@anytun.org>2009-03-22 17:50:10 +0000
commitfd419ce4f2bcadae313f4f368361c733c1249ae9 (patch)
treeba244a9428e8b9cd5e40ceaa3857ab15a7a1a93e /src/anytun.cpp
parentupdated config (new option auth-tag-length) (diff)
added error callback to resolver for better handling
of resolvCallback exceptions
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index 99f1560..5715d5a 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -97,6 +97,11 @@ void createConnection(const PacketSourceEndpoint & remote_end, window_size_t seq
#endif
}
+void createConnectionError(const std::exception& e)
+{
+ gSignalController.inject(SIGERROR, e.what());
+}
+
#ifndef ANYTUN_NOSYNC
void syncConnector(const OptionHost& connto)
{
@@ -463,7 +468,7 @@ int main(int argc, char* argv[])
src = new UDPPacketSource(gOpt.getLocalAddr(), gOpt.getLocalPort());
if(gOpt.getRemoteAddr() != "")
- gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(), boost::bind(createConnection, _1, gOpt.getSeqWindowSize(), gOpt.getMux()), gOpt.getResolvAddrType());
+ gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(), boost::bind(createConnection, _1, gOpt.getSeqWindowSize(), gOpt.getMux()), boost::bind(createConnectionError, _1), gOpt.getResolvAddrType());
HostList connect_to = gOpt.getRemoteSyncHosts();
#ifndef NO_ROUTING