Ticket #2137: announce_ip.patch
File announce_ip.patch, 7.9 KB (added by , 13 years ago) |
---|
-
docs/man/deluged.1
old new 48 48 .TP 49 49 .I -q --quiet 50 50 Sets the log level to 'none', this is the same as `\-L none` 51 .TP 52 .I -T NAME=VALUE, --libtorrent=NAME=VALUE, --lib-torrent=NAME=VALUE 53 Sets the libtorrent option NAME to the given value. 54 For example, `\-T announce_ip=10.0.0.1' causes deluged to announce itself with the given IP address. 55 For a complete list of options, see the libtorrent documentation. 51 56 52 57 .SH SEE ALSO 53 58 .B Homepage: -
libtorrent/docs/manual.html
old new 3058 3058 int inactivity_timeout; 3059 3059 int unchoke_interval; 3060 3060 int optimistic_unchoke_multiplier; 3061 addressannounce_ip;3061 string announce_ip; 3062 3062 int num_want; 3063 3063 int initial_picker_threshold; 3064 3064 int allowed_fast_set_size; -
libtorrent/docs/manual.rst
old new 3024 3024 int inactivity_timeout; 3025 3025 int unchoke_interval; 3026 3026 int optimistic_unchoke_multiplier; 3027 addressannounce_ip;3027 string announce_ip; 3028 3028 int num_want; 3029 3029 int initial_picker_threshold; 3030 3030 int allowed_fast_set_size; -
libtorrent/src/http_tracker_connection.cpp
old new 160 160 url += "&numwant="; 161 161 url += to_string((std::min)(tracker_req().num_want, 999)).elems; 162 162 163 if (m_settings.announce_ip != address()) 164 { 165 error_code ec; 166 std::string ip = m_settings.announce_ip.to_string(ec); 167 if (!ec) url += "&ip=" + ip; 168 } 163 if (m_settings.announce_ip != "") 164 url += "&ip=" + m_settings.announce_ip; 169 165 170 166 #ifndef TORRENT_DISABLE_ENCRYPTION 171 167 url += "&supportcrypto=1"; -
libtorrent/src/udp_tracker_connection.cpp
old new 506 506 detail::write_int64(req.uploaded, out); // uploaded 507 507 detail::write_int32(req.event, out); // event 508 508 // ip address 509 if (m_settings.announce_ip != address() && m_settings.announce_ip.is_v4()) 510 detail::write_uint32(m_settings.announce_ip.to_v4().to_ulong(), out); 509 if (m_settings.announce_ip != "") 510 { 511 address announce_ip = address::from_string(m_settings.announce_ip); 512 if (announce_ip.is_v4()) 513 detail::write_uint32(announce_ip.to_v4().to_ulong(), out); 514 else 515 detail::write_int32(0, out); 516 } 511 517 else 512 518 detail::write_int32(0, out); 513 519 detail::write_int32(req.key, out); // key -
libtorrent/bindings/python/src/session_settings.cpp
old new 38 38 .def_readwrite("inactivity_timeout", &session_settings::inactivity_timeout) 39 39 .def_readwrite("unchoke_interval", &session_settings::unchoke_interval) 40 40 .def_readwrite("optimistic_unchoke_multiplier", &session_settings::optimistic_unchoke_multiplier) 41 .def_readwrite("announce_ip", &session_settings::announce_ip) 41 42 .def_readwrite("num_want", &session_settings::num_want) 42 43 .def_readwrite("initial_picker_threshold", &session_settings::initial_picker_threshold) 43 44 .def_readwrite("allowed_fast_set_size", &session_settings::allowed_fast_set_size) -
libtorrent/include/libtorrent/session_settings.hpp
old new 109 109 , inactivity_timeout(600) 110 110 , unchoke_interval(15) 111 111 , optimistic_unchoke_multiplier(4) 112 , announce_ip() 112 113 , num_want(200) 113 114 , initial_picker_threshold(4) 114 115 , allowed_fast_set_size(10) … … 287 288 288 289 // if this is set, this IP will be reported do the 289 290 // tracker in the ip= parameter. 290 addressannounce_ip;291 std::string announce_ip; 291 292 292 293 // the num want sent to trackers 293 294 int num_want; -
deluge/core/daemon.py
old new 47 47 import deluge.error 48 48 49 49 class Daemon(object): 50 def __init__(self, options=None, args=None, classic=False):50 def __init__(self, parser, options=None, args=None, classic=False): 51 51 # Check for another running instance of the daemon 52 52 if os.path.isfile(deluge.configmanager.get_config_dir("deluged.pid")): 53 53 # Get the PID and the port of the supposedly running daemon … … 138 138 else: 139 139 listen_interface = "" 140 140 141 # Handle any libtorrent settings 142 settings_dict = {} 143 if options and options.libtorrent_settings: 144 for setting in options.libtorrent_settings: 145 opt = setting.split('=', 1) 146 if len(opt) != 2: 147 parser.error('--libtorrent requires name=value') 148 settings_dict[opt[0]] = opt[1] 149 141 150 from deluge.core.core import Core 142 151 # Start the core as a thread and join it until it's done 143 self.core = Core(listen_interface=listen_interface) 152 self.core = Core(listen_interface=listen_interface, 153 settings=settings_dict) 144 154 145 155 port = self.core.config["daemon_port"] 146 156 if options and options.port: -
deluge/core/core.py
old new 72 72 from deluge.core.rpcserver import export 73 73 74 74 class Core(component.Component): 75 def __init__(self, listen_interface=None ):75 def __init__(self, listen_interface=None, settings={}): 76 76 log.debug("Core init..") 77 77 component.Component.__init__(self, "Core") 78 78 … … 93 93 self.settings = lt.session_settings() 94 94 self.settings.user_agent = "Deluge %s" % deluge.common.get_version() 95 95 96 # Set sessionsettings96 # Set other default settings 97 97 self.settings.send_redundant_have = True 98 99 # Set passed settings 100 for key in settings.keys(): 101 if hasattr(self.settings, key): 102 setattr(self.settings, key, settings[key]) 103 else: 104 log.error("Illegal settings key %s" % key) 105 raise KeyError 106 107 # Set session settings 98 108 if deluge.common.windows_check(): 99 109 self.settings.disk_io_write_mode = \ 100 110 lt.io_buffer_mode_t.disable_os_cache -
deluge/main.py
old new 164 164 help="Set the log level: none, info, warning, error, critical, debug", action="store", type="str") 165 165 parser.add_option("-q", "--quiet", dest="quiet", 166 166 help="Sets the log level to 'none', this is the same as `-L none`", action="store_true", default=False) 167 parser.add_option("-T", "--libtorrent", "--lib-torrent", 168 dest="libtorrent_settings", action="append", metavar="NAME=VALUE", 169 help="Sets the libtorrent option NAME to VALUE") 167 170 parser.add_option("--profile", dest="profile", action="store_true", default=False, 168 171 help="Profiles the daemon") 169 172 … … 223 226 hsp.start() 224 227 try: 225 228 from deluge.core.daemon import Daemon 226 Daemon( options, args)229 Daemon(parser, options, args) 227 230 except deluge.error.DaemonRunningError, e: 228 231 log.error(e) 229 232 log.error("You cannot run multiple daemons with the same config directory set.")