mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-09 15:49:20 +00:00
* More rak::socket_address cleanup, made listening port seperate from
local address and use port 0 when listening port is closed. * Added "port_open" option which allows the user to not open any listening port. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@644 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -256,6 +256,9 @@ Manager::receive_download_done(Download* d) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
Manager::listen_open() {
|
Manager::listen_open() {
|
||||||
|
if (control->variables()->get_string("port_open") != "yes")
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_portFirst > m_portLast)
|
if (m_portFirst > m_portLast)
|
||||||
throw torrent::input_error("Invalid port range for listening");
|
throw torrent::input_error("Invalid port range for listening");
|
||||||
|
|
||||||
|
|||||||
+1
-8
@@ -196,18 +196,11 @@ main(int argc, char** argv) {
|
|||||||
|
|
||||||
control->cleanup();
|
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) {
|
} catch (std::exception& e) {
|
||||||
display::Canvas::cleanup();
|
display::Canvas::cleanup();
|
||||||
delete control;
|
delete control;
|
||||||
|
|
||||||
std::cout << e.what() << std::endl;
|
std::cout << "rtorrent: " << e.what() << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ initialize_option_handler(Control* c) {
|
|||||||
// Cleaned up.
|
// Cleaned up.
|
||||||
variables->insert("check_hash", new utils::VariableAny("yes"));
|
variables->insert("check_hash", new utils::VariableAny("yes"));
|
||||||
variables->insert("use_udp_trackers", 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("port_random", new utils::VariableAny("yes"));
|
||||||
|
|
||||||
variables->insert("session", new utils::VariableSlotString<>(NULL, rak::mem_fn(&control->core()->download_store(), &core::DownloadStore::set_path)));
|
variables->insert("session", new utils::VariableSlotString<>(NULL, rak::mem_fn(&control->core()->download_store(), &core::DownloadStore::set_path)));
|
||||||
|
|||||||
Reference in New Issue
Block a user