summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-03-04 20:59:57 +0000
committerChristian Pointner <equinox@anytun.org>2009-03-04 20:59:57 +0000
commit5317ca1778eddcf5db50c27f837143ffb8a08ef4 (patch)
tree8749ec10d72c9dbf7f86d066dfe9501795169921
parentfix build (diff)
cleanup
-rw-r--r--src/anytun.cpp20
-rw-r--r--src/resolver.cpp8
2 files changed, 5 insertions, 23 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index 0206055..e321b17 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -396,13 +396,7 @@ int main(int argc, char* argv[])
cLog.msg(Log::PRIO_NOTICE) << "anytun started...";
gOpt.parse_post(); // print warnings
-// gResolver.init();
-// gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort());
-// gResolver.resolveTcp(gOpt.getRemoteAddr(), gOpt.getRemotePort());
-
-// while(1)
-// boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
-// exit(0);
+ gResolver.init();
#ifndef NO_DAEMON
#ifndef NO_PRIVDROP
@@ -447,19 +441,9 @@ int main(int argc, char* argv[])
src = new UDPPacketSource(gOpt.getLocalAddr(), gOpt.getLocalPort());
HostList connect_to = gOpt.getRemoteSyncHosts();
-
-
if(gOpt.getRemoteAddr() != "")
- {
- gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(),
- boost::bind(createConnection, _1, gOpt.getSeqWindowSize(), gOpt.getMux()));
- ///*boost::asio::io_service io_service;
- //UDPPacketSource::proto::resolver resolver(io_service);
- //UDPPacketSource::proto::resolver::query query(gOpt.getRemoteAddr(), gOpt.getRemotePort());
- //UDPPacketSource::proto::endpoint endpoint = *resolver.resolve(query);
- //createConnection(endpoint,gOpt.getSeqWindowSize(), gOpt.getMux());*/
- }
+ gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(), boost::bind(createConnection, _1, gOpt.getSeqWindowSize(), gOpt.getMux()));
#ifndef NO_ROUTING
NetworkList routes = gOpt.getRoutes();
diff --git a/src/resolver.cpp b/src/resolver.cpp
index 5a230ae..7439f3d 100644
--- a/src/resolver.cpp
+++ b/src/resolver.cpp
@@ -79,15 +79,13 @@ void Resolver::init()
thread_ = new boost::thread(boost::bind(&Resolver::run, this));
}
-void Resolver::run(/*void* s*/)
+void Resolver::run()
{
- //Resolver* self = reinterpret_cast<Resolver*>(s);
-
cLog.msg(Log::PRIO_DEBUG) << "Resolver Thread started";
while(1) {
- /*self->*/io_service_.run();
- /*self->*/io_service_.reset();
+ io_service_.run();
+ io_service_.reset();
boost::this_thread::sleep(boost::posix_time::milliseconds(250));
}
}