mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 00:18:39 +00:00
lt 2876 - support for UPnP routers that don't provide a urlbase
This commit is contained in:
parent
c2cbeda738
commit
150bbd51cd
1 changed files with 14 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue