Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
libktorrent
Commits
9a55b51c
Commit
9a55b51c
authored
Jul 20, 2021
by
Yaroslav Kurlaev
Committed by
Andrius Štikonas
Aug 15, 2021
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
Changes
2
Show whitespace changes
Inline
Side-by-side
src/upnp/upnprouter.cpp
View file @
9a55b51c
...
...
@@ -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
);
}
...
...
src/upnp/upnprouter.h
View file @
9a55b51c
...
...
@@ -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
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment