Merge pull request #37 from jpetso/master

Progress towards a workable CMake build
This commit is contained in:
Arvid Norberg 2015-07-20 09:49:37 -07:00
commit a1b73317ce
16 changed files with 74 additions and 55 deletions

View File

@ -26,6 +26,7 @@ set(sources
entry entry
error_code error_code
file_storage file_storage
file_progress
lazy_bdecode lazy_bdecode
escape_string escape_string
string_util string_util
@ -180,12 +181,14 @@ if (build_tests)
add_definitions(-DTORRENT_EXPORT_EXTRA) add_definitions(-DTORRENT_EXPORT_EXTRA)
endif (build_tests) endif (build_tests)
find_package(Threads REQUIRED)
include_directories(${includes}) include_directories(${includes})
add_definitions(-DTORRENT_BUILDING_LIBRARY) add_definitions(-DTORRENT_BUILDING_LIBRARY)
if (encryption) if (encryption)
list(APPEND sources pe_crypto asio_ssl) list(APPEND sources mpi pe_crypto asio_ssl)
if(NOT DEFINED OPENSSL_INCLUDE_DIR OR NOT DEFINED OPENSSL_LIBRARIES) if(NOT DEFINED OPENSSL_INCLUDE_DIR OR NOT DEFINED OPENSSL_LIBRARIES)
FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE(OpenSSL REQUIRED)
endif() endif()
@ -215,15 +218,14 @@ else()
add_definitions(-DTORRENT_DISABLE_DHT) add_definitions(-DTORRENT_DISABLE_DHT)
endif() endif()
if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
endif()
if (shared) if (shared)
add_definitions(-DTORRENT_BUILDING_SHARED) add_definitions(-DTORRENT_BUILDING_SHARED)
add_library(torrent-rasterbar SHARED ${sources2}) add_library(torrent-rasterbar SHARED ${sources2})
else (shared) if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif()
else()
if(static_runtime) if(static_runtime)
# fix /MT flag: # fix /MT flag:
set(CompilerFlags set(CompilerFlags
@ -245,16 +247,16 @@ endif()
# Boost # Boost
if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES) if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)
FIND_PACKAGE( Boost COMPONENTS system thread date_time chrono random) FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)
endif() endif()
include_directories(${Boost_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}) target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
# this works around a bug in asio in boost-1.39 # this works around a bug in asio in boost-1.39
#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -D__USE_W32_SOCKETS -DWIN32_LEAN_AND_MEAN ) #add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -D__USE_W32_SOCKETS -DWIN32_LEAN_AND_MEAN )
if(NOT static_runtime) if(NOT static_runtime)
add_definitions(-DBOOST_ASIO_DYN_LINK -DBOOST_DATE_TIME_DYN_LINK -DBOOST_THREAD_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK) add_definitions(-DBOOST_ASIO_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_RANDOM_DYN_LINK)
else() else()
add_definitions(-DBOOST_ASIO_SEPARATE_COMPILATION) add_definitions(-DBOOST_ASIO_SEPARATE_COMPILATION)
endif() endif()
@ -360,22 +362,23 @@ configure_file(examples/run_cmake.sh.in examples/run_cmake.sh)
# === build tests === # === build tests ===
if(build_tests) if(build_tests)
FILE(GLOB tests RELATIVE "${PROJECT_SOURCE_DIR}" "test/test_*.cpp") file(GLOB tests RELATIVE "${PROJECT_SOURCE_DIR}" "test/test_*.cpp")
add_library(test_common STATIC test/main.cpp test/setup_transfer.cpp list(REMOVE_ITEM tests "test/test_natpmp.cpp") # doesn't build at time of writing
test/dht_server.cpp test/udp_tracker.cpp test/peer_server.cpp list(REMOVE_ITEM tests "test/test_utils.cpp") # helper file, not a test
test/web_seed_suite.cpp test/test_utils.cpp)
add_library(test_common OBJECT test/main.cpp test/test.cpp
test/setup_transfer.cpp test/dht_server.cpp test/udp_tracker.cpp
test/peer_server.cpp test/web_seed_suite.cpp test/swarm_suite.cpp
test/test_utils.cpp)
enable_testing() enable_testing()
foreach(s ${tests}) foreach(s ${tests})
get_filename_component (sn ${s} NAME_WE) get_filename_component (sn ${s} NAME_WE)
add_executable(${sn} ${s}) add_executable(${sn} ${s} $<TARGET_OBJECTS:test_common>)
target_link_libraries(${sn} torrent-rasterbar test_common) target_link_libraries(${sn} torrent-rasterbar)
add_test(${sn} ${s}) add_test(${sn} ${s})
endforeach(s) endforeach(s)
# add_executable(test_upnp test/test_upnp.cpp) add_executable(bdecode_benchmark test/bdecode_benchmark.cpp)
# target_link_libraries(test_upnp torrent-rasterbar) target_link_libraries(bdecode_benchmark torrent-rasterbar)
# add_executable(test_natpmp test/test_natpmp.cpp)
# target_link_libraries(test_natpmp torrent-rasterbar)
endif() endif()

View File

@ -567,9 +567,6 @@ defines you can use to control the build.
| ``TORRENT_DISABLE_DHT`` | If this is defined, the support for trackerless | | ``TORRENT_DISABLE_DHT`` | If this is defined, the support for trackerless |
| | torrents will be disabled. | | | torrents will be disabled. |
+----------------------------------------+-------------------------------------------------+ +----------------------------------------+-------------------------------------------------+
| ``TORRENT_DHT_VERBOSE_LOGGING`` | This will enable verbose logging of the DHT |
| | protocol traffic. |
+----------------------------------------+-------------------------------------------------+
| ``TORRENT_DISABLE_ENCRYPTION`` | This will disable any encryption support and | | ``TORRENT_DISABLE_ENCRYPTION`` | This will disable any encryption support and |
| | the dependencies of a crypto library. | | | the dependencies of a crypto library. |
| | Encryption support is the peer connection | | | Encryption support is the peer connection |

View File

@ -21,9 +21,22 @@ find_package(Boost REQUIRED COMPONENTS system)
include_directories(${LibtorrentRasterbar_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) include_directories(${LibtorrentRasterbar_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
add_definitions(${LibtorrentRasterbar_DEFINITIONS}) add_definitions(${LibtorrentRasterbar_DEFINITIONS})
FILE(GLOB examples RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cpp") set(single_file_examples
foreach(s ${examples}) simple_client
get_filename_component (sn ${s} NAME_WE) stats_counters
add_executable(${sn} ${s}) dump_torrent
target_link_libraries(${sn} ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES}) make_torrent
endforeach(s) connection_tester
upnp_test)
foreach(example ${single_file_examples})
add_executable(${example} "${example}.cpp")
target_link_libraries(${example} ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES})
endforeach(example)
add_executable(client_test
client_test.cpp
print.cpp
torrent_view.cpp
session_view.cpp)
target_link_libraries(client_test ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES})

View File

@ -11,6 +11,7 @@
# LibtorrentRasterbar_DEFINITIONS - Compiler switches required for using libtorrent-rasterbar # LibtorrentRasterbar_DEFINITIONS - Compiler switches required for using libtorrent-rasterbar
# LibtorrentRasterbar_OPENSSL_ENABLED - libtorrent-rasterbar uses and links against OpenSSL # LibtorrentRasterbar_OPENSSL_ENABLED - libtorrent-rasterbar uses and links against OpenSSL
find_package(Threads REQUIRED)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
@ -19,7 +20,7 @@ endif()
if(LibtorrentRasterbar_USE_STATIC_LIBS) if(LibtorrentRasterbar_USE_STATIC_LIBS)
set(LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif() endif()
if(PC_LIBTORRENT_RASTERBAR_FOUND) if(PC_LIBTORRENT_RASTERBAR_FOUND)
@ -43,7 +44,6 @@ else()
else() else()
list(APPEND LibtorrentRasterbar_DEFINITIONS list(APPEND LibtorrentRasterbar_DEFINITIONS
-DTORRENT_LINKING_SHARED -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED -DBOOST_ASIO_DYN_LINK
-DBOOST_DATE_TIME_DYN_LINK -DBOOST_THREAD_DYN_LINK
-DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK) -DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK)
endif() endif()
endif() endif()
@ -61,13 +61,15 @@ if(LibtorrentRasterbar_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ${LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif() endif()
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARY}) set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIR}) set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIR})
if(NOT Boost_SYSTEM_FOUND OR NOT Boost_THREAD_FOUND OR NOT Boost_DATE_TIME_FOUND OR NOT Boost_CHRONO_FOUND) if(NOT Boost_SYSTEM_FOUND OR NOT Boost_CHRONO_FOUND OR NOT Boost_RANDOM_FOUND)
find_package(Boost REQUIRED COMPONENTS system thread date_time chrono) find_package(Boost REQUIRED COMPONENTS system chrono random)
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES}) set(LibtorrentRasterbar_LIBRARIES
set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) ${LibtorrentRasterbar_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
set(LibtorrentRasterbar_INCLUDE_DIRS
${LibtorrentRasterbar_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
endif() endif()
list(FIND LibtorrentRasterbar_DEFINITIONS -DTORRENT_USE_OPENSSL LibtorrentRasterbar_ENCRYPTION_INDEX) list(FIND LibtorrentRasterbar_DEFINITIONS -DTORRENT_USE_OPENSSL LibtorrentRasterbar_ENCRYPTION_INDEX)
@ -85,9 +87,8 @@ find_package_handle_standard_args(LibtorrentRasterbar DEFAULT_MSG
LibtorrentRasterbar_LIBRARY LibtorrentRasterbar_LIBRARY
LibtorrentRasterbar_INCLUDE_DIR LibtorrentRasterbar_INCLUDE_DIR
Boost_SYSTEM_FOUND Boost_SYSTEM_FOUND
Boost_THREAD_FOUND Boost_CHRONO_FOUND
Boost_DATE_TIME_FOUND Boost_RANDOM_FOUND)
Boost_CHRONO_FOUND)
mark_as_advanced(LibtorrentRasterbar_INCLUDE_DIR LibtorrentRasterbar_LIBRARY mark_as_advanced(LibtorrentRasterbar_INCLUDE_DIR LibtorrentRasterbar_LIBRARY
LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES

View File

@ -54,7 +54,6 @@ namespace libtorrent
class torrent; class torrent;
struct ip_filter; struct ip_filter;
class port_filter; class port_filter;
class connection_queue;
class alert; class alert;
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE

View File

@ -9,7 +9,7 @@ exe test_natpmp : test_natpmp.cpp /torrent//torrent
exe enum_if : enum_if.cpp /torrent//torrent exe enum_if : enum_if.cpp /torrent//torrent
: <threading>multi <debug-iterators>on <invariant-checks>full ; : <threading>multi <debug-iterators>on <invariant-checks>full ;
exe bdecode_benchmark : test_bdecode_performance.cpp /torrent//torrent exe bdecode_benchmark : bdecode_benchmark.cpp /torrent//torrent
: <variant>release ; : <variant>release ;
explicit test_natpmp ; explicit test_natpmp ;

View File

@ -1,6 +1,7 @@
AUTOMAKE_OPTIONS = subdir-objects AUTOMAKE_OPTIONS = subdir-objects
test_programs = \ test_programs = \
bdecode_benchmark \
test_primitives \ test_primitives \
test_recheck \ test_recheck \
test_stat_cache \ test_stat_cache \
@ -8,7 +9,6 @@ test_programs = \
test_privacy \ test_privacy \
test_priority \ test_priority \
test_auto_unchoke \ test_auto_unchoke \
test_bdecode_performance \
test_checking \ test_checking \
test_fast_extension \ test_fast_extension \
test_http_connection \ test_http_connection \
@ -158,13 +158,13 @@ test_primitives_SOURCES = \
test_dos_blocker.cpp \ test_dos_blocker.cpp \
test_upnp.cpp test_upnp.cpp
bdecode_benchmark_SOURCES = bdecode_benchmark.cpp
test_recheck_SOURCES = test_recheck.cpp test_recheck_SOURCES = test_recheck.cpp
test_stat_cache_SOURCES = test_stat_cache.cpp test_stat_cache_SOURCES = test_stat_cache.cpp
test_file_SOURCES = test_file.cpp test_file_SOURCES = test_file.cpp
test_privacy_SOURCES = test_privacy.cpp test_privacy_SOURCES = test_privacy.cpp
test_priority_SOURCES = test_priority.cpp test_priority_SOURCES = test_priority.cpp
test_auto_unchoke_SOURCES = test_auto_unchoke.cpp test_auto_unchoke_SOURCES = test_auto_unchoke.cpp
test_bdecode_performance_SOURCES = test_bdecode_performance.cpp
test_checking_SOURCES = test_checking.cpp test_checking_SOURCES = test_checking.cpp
test_fast_extension_SOURCES = test_fast_extension.cpp test_fast_extension_SOURCES = test_fast_extension.cpp
test_http_connection_SOURCES = test_http_connection.cpp test_http_connection_SOURCES = test_http_connection.cpp

View File

@ -241,7 +241,7 @@ TORRENT_TEST(wait_for_alert)
alert* a = mgr.wait_for_alert(seconds(1)); alert* a = mgr.wait_for_alert(seconds(1));
time_point end = clock_type::now(); time_point end = clock_type::now();
TEST_EQUAL(a, NULL); TEST_EQUAL(a, static_cast<alert*>(0));
TEST_CHECK(end - start > milliseconds(900)); TEST_CHECK(end - start > milliseconds(900));
TEST_CHECK(end - start < milliseconds(1100)); TEST_CHECK(end - start < milliseconds(1100));

View File

@ -471,7 +471,7 @@ TORRENT_TEST(bencoding)
TEST_EQUAL(ps.len, 6); TEST_EQUAL(ps.len, 6);
ps = e.dict_find_pstr("foobar2"); ps = e.dict_find_pstr("foobar2");
TEST_EQUAL(ps.ptr, NULL); TEST_EQUAL(ps.ptr, static_cast<char const*>(0));
TEST_EQUAL(ps.len, 0); TEST_EQUAL(ps.len, 0);
} }
@ -491,7 +491,7 @@ TORRENT_TEST(bencoding)
TEST_EQUAL(ps.len, 6); TEST_EQUAL(ps.len, 6);
ps = e.list_pstr_at(1); ps = e.list_pstr_at(1);
TEST_EQUAL(ps.ptr, NULL); TEST_EQUAL(ps.ptr, static_cast<char const*>(0));
TEST_EQUAL(ps.len, 0); TEST_EQUAL(ps.len, 0);
} }

View File

@ -1069,7 +1069,7 @@ TORRENT_TEST(dht)
printf("num_active_buckets: %d\n", tbl.num_active_buckets()); printf("num_active_buckets: %d\n", tbl.num_active_buckets());
TEST_EQUAL(tbl.num_active_buckets(), 6); TEST_EQUAL(tbl.num_active_buckets(), 6);
#if defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG #if defined TORRENT_DEBUG
tbl.print_state(std::cerr); tbl.print_state(std::cerr);
#endif #endif
} }
@ -1088,7 +1088,7 @@ TORRENT_TEST(dht)
} }
TEST_EQUAL(tbl.num_active_buckets(), 6); TEST_EQUAL(tbl.num_active_buckets(), 6);
#if defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG #if defined TORRENT_DEBUG
tbl.print_state(std::cerr); tbl.print_state(std::cerr);
#endif #endif
} }
@ -1340,7 +1340,7 @@ TORRENT_TEST(dht)
//#error test num_global_nodes //#error test num_global_nodes
//#error test need_refresh //#error test need_refresh
#if defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG #if defined TORRENT_DEBUG
table.print_state(std::cerr); table.print_state(std::cerr);
#endif #endif

View File

@ -33,7 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/natpmp.hpp" #include "libtorrent/natpmp.hpp"
#include "libtorrent/socket.hpp" #include "libtorrent/socket.hpp"
#include "libtorrent/socket_io.hpp" #include "libtorrent/socket_io.hpp"
#include "libtorrent/connection_queue.hpp"
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/ref.hpp> #include <boost/ref.hpp>
#include <boost/intrusive_ptr.hpp> #include <boost/intrusive_ptr.hpp>
@ -66,7 +65,6 @@ int main(int argc, char* argv[])
return 1; return 1;
} }
connection_queue cc(ios);
boost::intrusive_ptr<natpmp> natpmp_handler = new natpmp(ios, address_v4() boost::intrusive_ptr<natpmp> natpmp_handler = new natpmp(ios, address_v4()
, &callback, &log_callback); , &callback, &log_callback);

View File

@ -86,14 +86,14 @@ TORRENT_TEST(insert)
for (int i = 0; i < 0xff; ++i) for (int i = 0; i < 0xff; ++i)
{ {
int index = (i + 0xfff0) & 0xffff; int index = (i + 0xfff0) & 0xffff;
pb.insert(index, (void*)(index + 1)); pb.insert(index, reinterpret_cast<void*>(index + 1));
fprintf(stderr, "insert: %u (mask: %x)\n", index, int(pb.capacity() - 1)); fprintf(stderr, "insert: %u (mask: %x)\n", index, int(pb.capacity() - 1));
TEST_EQUAL(pb.capacity(), 512); TEST_EQUAL(pb.capacity(), 512);
if (i >= 14) if (i >= 14)
{ {
index = (index - 14) & 0xffff; index = (index - 14) & 0xffff;
fprintf(stderr, "remove: %u\n", index); fprintf(stderr, "remove: %u\n", index);
TEST_CHECK(pb.remove(index) == (void*)(index + 1)); TEST_CHECK(pb.remove(index) == reinterpret_cast<void*>(index + 1));
TEST_EQUAL(pb.size(), 14); TEST_EQUAL(pb.size(), 14);
} }
} }

View File

@ -43,6 +43,8 @@ using namespace libtorrent;
namespace lt = libtorrent; namespace lt = libtorrent;
using boost::tuples::ignore; using boost::tuples::ignore;
namespace {
template <class T> template <class T>
boost::shared_ptr<T> clone_ptr(boost::shared_ptr<T> const& ptr) boost::shared_ptr<T> clone_ptr(boost::shared_ptr<T> const& ptr)
{ {
@ -59,6 +61,8 @@ bool on_alert(alert const* a)
return false; return false;
} }
} // anonymous namespace
void test_remap_files_gather(storage_mode_t storage_mode = storage_mode_sparse) void test_remap_files_gather(storage_mode_t storage_mode = storage_mode_sparse)
{ {
// in case the previous run was terminated // in case the previous run was terminated

View File

@ -294,7 +294,7 @@ TORRENT_TEST(string)
TEST_EQUAL(ptr, std::string("f")); TEST_EQUAL(ptr, std::string("f"));
ptr = string_tokenize(next, ' ', &next); ptr = string_tokenize(next, ' ', &next);
TEST_EQUAL(ptr, NULL); TEST_EQUAL(ptr, static_cast<char*>(0));
TEST_EQUAL(std::string("foobar"), convert_from_native(convert_to_native("foobar"))); TEST_EQUAL(std::string("foobar"), convert_from_native(convert_to_native("foobar")));
TEST_EQUAL(std::string("foobar") TEST_EQUAL(std::string("foobar")

View File

@ -54,6 +54,8 @@ POSSIBILITY OF SUCH DAMAGE.
using namespace libtorrent; using namespace libtorrent;
namespace lt = libtorrent; namespace lt = libtorrent;
namespace {
int peer_disconnects = 0; int peer_disconnects = 0;
bool on_alert(alert const* a) bool on_alert(alert const* a)
@ -80,6 +82,8 @@ static sha1_hash file_hash(std::string const& name)
*/ */
static char const* proxy_name[] = {"", "_socks4", "_socks5", "_socks5_pw", "_http", "_http_pw", "_i2p"}; static char const* proxy_name[] = {"", "_socks4", "_socks5", "_socks5_pw", "_http", "_http_pw", "_i2p"};
} // anonymous namespace
// proxy: 0=none, 1=socks4, 2=socks5, 3=socks5_pw 4=http 5=http_pw // proxy: 0=none, 1=socks4, 2=socks5, 3=socks5_pw 4=http 5=http_pw
void test_transfer(lt::session& ses, boost::shared_ptr<torrent_info> torrent_file void test_transfer(lt::session& ses, boost::shared_ptr<torrent_info> torrent_file
, int proxy, int port, char const* protocol, bool url_seed , int proxy, int port, char const* protocol, bool url_seed