From 5e290275d258b8f79e1bad7dc92847b36a4ce208 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 30 Jul 2008 05:31:22 +0000 Subject: [PATCH] Add session::settings() and ability to set outgoing_ports in session --- bindings/python/src/session.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 4c9e65e42..569a85d48 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -68,7 +68,14 @@ namespace allow_threading_guard guard; return s.listen_on(std::make_pair(min_, max_), interface); } - + void outgoing_ports(session& s, int _min, int _max) + { + allow_threading_guard guard; + session_settings settings = s.settings(); + settings.outgoing_ports = std::make_pair(_min, _max); + s.set_settings(settings); + return; + } #ifndef TORRENT_DISABLE_DHT void add_dht_router(session& s, std::string router_, int port_) { @@ -257,6 +264,7 @@ void bind_session() , (arg("min"), "max", arg("interface") = (char const*)0) , session_listen_on_doc ) + .def("outgoing_ports", &outgoing_ports) .def("is_listening", allow_threads(&session::is_listening), session_is_listening_doc) .def("listen_port", allow_threads(&session::listen_port), session_listen_port_doc) .def("status", allow_threads(&session::status), session_status_m_doc) @@ -309,6 +317,7 @@ void bind_session() , session_num_connections_doc ) .def("set_settings", allow_threads(&session::set_settings), session_set_settings_doc) + .def("settings", allow_threads(&session::settings), return_value_policy()) #ifndef TORRENT_DISABLE_ENCRYPTION .def("set_pe_settings", allow_threads(&session::set_pe_settings), session_set_pe_settings_doc) .def("get_pe_settings", allow_threads(&session::get_pe_settings), return_value_policy())