From f36d360b8ba8acd9457fc71c8a2f05911b408f71 Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 17 Jun 2015 17:40:38 -0400 Subject: [PATCH] merged fix from RC_1_0 --- ChangeLog | 1 + bindings/python/src/session.cpp | 7 +++++++ include/libtorrent/session.hpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b938ded7..c50c58b73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -71,6 +71,7 @@ * almost completely changed the storage interface (for custom storage) * added support for hashing pieces in multiple threads + * add missing port mapping functions to python binding * fix bound-checking issue in bdecoder * expose missing dht_settings fields to python * add function to query the DHT settings diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 3accc2e27..6932b3c0b 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -721,6 +721,8 @@ void bind_session() .def("is_paused", allow_threads(<::session::is_paused)) .def("id", allow_threads(<::session::id)) .def("get_cache_info", &get_cache_info1, (arg("handle") = torrent_handle(), arg("flags") = 0)) + .def("add_port_mapping", allow_threads(&session::add_port_mapping)) + .def("delete_port_mapping", allow_threads(&session::delete_port_mapping)) #ifndef TORRENT_NO_DEPRECATE .def( @@ -773,6 +775,11 @@ void bind_session() #endif // TORRENT_NO_DEPRECATE ; + enum_("protocol_type") + .value("udp", session::udp) + .value("tcp", session::tcp) + ; + enum_("save_state_flags_t") .value("save_settings", lt::session::save_settings) .value("save_dht_settings", lt::session::save_dht_settings) diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index c87c6fd5e..53238061b 100644 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -1218,7 +1218,7 @@ namespace libtorrent // // deprecated. use settings_pack::enable_upnp instead TORRENT_DEPRECATED - void start_upnp(); + void start_upnp(); TORRENT_DEPRECATED void stop_upnp();