From aafc0bab4e2358a22974c360e9a69e3720f0a593 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 19 Sep 2009 00:09:34 +0000 Subject: [PATCH] fixed test_natpmp build --- test/test_natpmp.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/test_natpmp.cpp b/test/test_natpmp.cpp index 060e29f31..cb0fd8a67 100644 --- a/test/test_natpmp.cpp +++ b/test/test_natpmp.cpp @@ -4,12 +4,21 @@ #include #include #include +#include using namespace libtorrent; -void callback(int mapping, int port, std::string const& err) +void callback(int mapping, int port, error_code const& err) { - std::cerr << "mapping: " << mapping << ", port: " << port << ", error: \"" << err << "\"\n"; + std::cerr + << "mapping: " << mapping + << ", port: " << port + << ", error: \"" << err.message() << "\"\n"; +} + +void log_callback(char const* line) +{ + std::cerr << line << std::endl; } int main(int argc, char* argv[]) @@ -24,7 +33,8 @@ int main(int argc, char* argv[]) } connection_queue cc(ios); - boost::intrusive_ptr natpmp_handler = new natpmp(ios, address_v4(), &callback); + boost::intrusive_ptr natpmp_handler = new natpmp(ios, address_v4() + , &callback, &log_callback); deadline_timer timer(ios);