lt 2876 - support for UPnP routers that don't provide a urlbase
This commit is contained in:
parent
12a6be4e20
commit
8a092a2f79
@ -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
|
#ifdef TORRENT_UPNP_LOGGING
|
||||||
m_log << time_now_string()
|
m_log << time_now_string()
|
||||||
<< " <== (" << d.url << ") Rootdevice response, found control URL: " << s.control_url
|
<< " <== (" << d.url << ") Rootdevice response, found control URL: " << d.control_url
|
||||||
<< " namespace: " << d.service_namespace << std::endl;
|
<< " urlbase: " << s.url_base << " namespace: " << d.service_namespace << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (s.url_base.empty()) d.control_url = s.control_url;
|
if (s.url_base.empty()) d.control_url = s.control_url;
|
||||||
else d.control_url = s.url_base + 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)
|
boost::tie(protocol, auth, d.hostname, d.port, d.path, error)
|
||||||
= parse_url_components(d.control_url);
|
= parse_url_components(d.control_url);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user