Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
a61adb53
Commit
a61adb53
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
pupnp: init on default ipv4 interface
Change-Id: I149e0e007c570c36dca2b3fa98d099fe6aeaedf7
parent
63a1face
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/upnp/protocol/pupnp/pupnp.cpp
+9
-4
9 additions, 4 deletions
src/upnp/protocol/pupnp/pupnp.cpp
with
9 additions
and
4 deletions
src/upnp/protocol/pupnp/pupnp.cpp
+
9
−
4
View file @
a61adb53
...
@@ -112,7 +112,11 @@ PUPnP::initUpnpLib()
...
@@ -112,7 +112,11 @@ PUPnP::initUpnpLib()
{
{
assert
(
not
initialized_
);
assert
(
not
initialized_
);
int
upnp_err
=
UpnpInit2
(
nullptr
,
0
);
auto
hostinfo
=
ip_utils
::
getHostName
();
if
(
logger_
)
logger_
->
debug
(
"PUPnP: Initializing libupnp {} {}"
,
hostinfo
.
address
,
hostinfo
.
interface
);
int
upnp_err
=
UpnpInit2
(
hostinfo
.
interface
.
empty
()
?
nullptr
:
hostinfo
.
interface
.
c_str
(),
0
);
if
(
upnp_err
!=
UPNP_E_SUCCESS
)
{
if
(
upnp_err
!=
UPNP_E_SUCCESS
)
{
if
(
logger_
)
logger_
->
error
(
"PUPnP: Can't initialize libupnp: {}"
,
UpnpGetErrorMessage
(
upnp_err
));
if
(
logger_
)
logger_
->
error
(
"PUPnP: Can't initialize libupnp: {}"
,
UpnpGetErrorMessage
(
upnp_err
));
...
@@ -693,14 +697,15 @@ PUPnP::ctrlPtCallback(Upnp_EventType event_type, const void* event, void* user_d
...
@@ -693,14 +697,15 @@ PUPnP::ctrlPtCallback(Upnp_EventType event_type, const void* event, void* user_d
auto
pupnp
=
static_cast
<
PUPnP
*>
(
user_data
);
auto
pupnp
=
static_cast
<
PUPnP
*>
(
user_data
);
if
(
pupnp
==
nullptr
)
{
if
(
pupnp
==
nullptr
)
{
// JAMI_WARN(
"PUPnP: Control point callback without PUPnP");
fmt
::
print
(
stderr
,
"PUPnP: Control point callback without PUPnP"
);
return
UPNP_E_SUCCESS
;
return
UPNP_E_SUCCESS
;
}
}
auto
upnpThis
=
pupnp
->
weak
().
lock
();
auto
upnpThis
=
pupnp
->
weak
().
lock
();
if
(
not
upnpThis
)
{
if
(
not
upnpThis
)
fmt
::
print
(
stderr
,
"PUPnP: Control point callback without PUPnP"
);
return
UPNP_E_SUCCESS
;
return
UPNP_E_SUCCESS
;
}
// Ignore if already unregistered.
// Ignore if already unregistered.
if
(
not
upnpThis
->
clientRegistered_
)
if
(
not
upnpThis
->
clientRegistered_
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment