mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-22 16:18:15 +00:00
lt 2876 - support for UPnP routers that don't provide a urlbase
This commit is contained in:
parent
c2cbeda738
commit
150bbd51cd
@ -160,7 +160,7 @@ int upnp::add_mapping(upnp::protocol_type p, int external_port, int local_port)
|
||||
m_log << time_now_string()
|
||||
<< " *** add mapping [ proto: " << (p == tcp?"tcp":"udp")
|
||||
<< " ext_port: " << external_port
|
||||
<< " local_port :" << local_port << " ]";
|
||||
<< " local_port:" << local_port << " ]";
|
||||
if (m_disabled) m_log << " DISABLED";
|
||||
m_log << std::endl;
|
||||
#endif
|
||||
@ -894,18 +894,26 @@ void upnp::on_upnp_xml(error_code const& e
|
||||
}
|
||||
}
|
||||
|
||||
std::string protocol;
|
||||
std::string auth;
|
||||
char const* error;
|
||||
if (!d.control_url.empty() && d.control_url[0] == '/')
|
||||
{
|
||||
boost::tie(protocol, auth, d.hostname, d.port, d.path, error)
|
||||
= parse_url_components(d.url);
|
||||
d.control_url = protocol + "://" + d.hostname + ":"
|
||||
+ boost::lexical_cast<std::string>(d.port) + s.control_url;
|
||||
}
|
||||
|
||||
#ifdef TORRENT_UPNP_LOGGING
|
||||
m_log << time_now_string()
|
||||
<< " <== (" << d.url << ") Rootdevice response, found control URL: " << s.control_url
|
||||
<< " namespace: " << d.service_namespace << std::endl;
|
||||
<< " <== (" << d.url << ") Rootdevice response, found control URL: " << d.control_url
|
||||
<< " urlbase: " << s.url_base << " namespace: " << d.service_namespace << std::endl;
|
||||
#endif
|
||||
|
||||
if (s.url_base.empty()) d.control_url = s.control_url;
|
||||
else d.control_url = s.url_base + s.control_url;
|
||||
|
||||
std::string protocol;
|
||||
std::string auth;
|
||||
char const* error;
|
||||
boost::tie(protocol, auth, d.hostname, d.port, d.path, error)
|
||||
= parse_url_components(d.control_url);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user