Commit 9a55b51c authored by Yaroslav Kurlaev's avatar Yaroslav Kurlaev Committed by Andrius Štikonas
Browse files

Handle URLs without host and port in UPnP

MiniUPnPd sends them like this and they are handled ok in other apps
parent fb083f5b
......@@ -149,12 +149,18 @@ UPnPRouter::~UPnPRouter()
delete d;
}
void UPnPRouter::addService(const UPnPService &s)
void UPnPRouter::addService(UPnPService s)
{
for (const UPnPService &os : qAsConst(d->services)) {
if (s.servicetype == os.servicetype)
return;
}
if (s.controlurl.startsWith("/")) {
s.controlurl = "http://" + d->location.host() + ":" + QString::number(d->location.port()) + s.controlurl;
}
if (s.eventsuburl.startsWith("/")) {
s.controlurl = "http://" + d->location.host() + ":" + QString::number(d->location.port()) + s.eventsuburl;
}
d->services.append(s);
}
......
......@@ -134,7 +134,7 @@ public:
* Add a service to the router.
* @param s The service
*/
void addService(const UPnPService &s);
void addService(UPnPService s);
#if 0
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment