diff --git a/src/core/manager.cc b/src/core/manager.cc index 9fb6d14c..fe7ef906 100644 --- a/src/core/manager.cc +++ b/src/core/manager.cc @@ -256,6 +256,9 @@ Manager::receive_download_done(Download* d) { void Manager::listen_open() { + if (control->variables()->get_string("port_open") != "yes") + return; + if (m_portFirst > m_portLast) throw torrent::input_error("Invalid port range for listening"); diff --git a/src/main.cc b/src/main.cc index 1b863c01..5d77e2c2 100644 --- a/src/main.cc +++ b/src/main.cc @@ -196,18 +196,11 @@ main(int argc, char** argv) { control->cleanup(); - } catch (torrent::base_error& e) { - display::Canvas::cleanup(); - delete control; - - std::cout << "Caught exception: " << e.what() << std::endl; - return -1; - } catch (std::exception& e) { display::Canvas::cleanup(); delete control; - std::cout << e.what() << std::endl; + std::cout << "rtorrent: " << e.what() << std::endl; return -1; } diff --git a/src/option_handler_rules.cc b/src/option_handler_rules.cc index 97c90bc8..817e3ffc 100644 --- a/src/option_handler_rules.cc +++ b/src/option_handler_rules.cc @@ -159,6 +159,7 @@ initialize_option_handler(Control* c) { // Cleaned up. variables->insert("check_hash", new utils::VariableAny("yes")); variables->insert("use_udp_trackers", new utils::VariableAny("yes")); + variables->insert("port_open", new utils::VariableAny("yes")); variables->insert("port_random", new utils::VariableAny("yes")); variables->insert("session", new utils::VariableSlotString<>(NULL, rak::mem_fn(&control->core()->download_store(), &core::DownloadStore::set_path)));