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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
56740314
Commit
56740314
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
mapping: cleanup
Change-Id: I126589619de15382b7d6ceef7f28aeb404c04633
parent
b75ab9d3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/upnp/mapping.h
+1
-2
1 addition, 2 deletions
include/upnp/mapping.h
src/upnp/protocol/mapping.cpp
+0
-14
0 additions, 14 deletions
src/upnp/protocol/mapping.cpp
src/upnp/upnp_context.cpp
+1
-1
1 addition, 1 deletion
src/upnp/upnp_context.cpp
with
2 additions
and
17 deletions
include/upnp/mapping.h
+
1
−
2
View file @
56740314
...
@@ -36,7 +36,7 @@ enum class MappingState { PENDING, IN_PROGRESS, FAILED, OPEN };
...
@@ -36,7 +36,7 @@ enum class MappingState { PENDING, IN_PROGRESS, FAILED, OPEN };
enum
class
NatProtocolType
;
enum
class
NatProtocolType
;
class
IGD
;
class
IGD
;
class
Mapping
:
std
::
enable_shared_from_this
<
Mapping
>
class
Mapping
{
{
friend
class
UPnPContext
;
friend
class
UPnPContext
;
friend
class
NatPmp
;
friend
class
NatPmp
;
...
@@ -112,7 +112,6 @@ private:
...
@@ -112,7 +112,6 @@ private:
void
setIgd
(
const
std
::
shared_ptr
<
IGD
>&
igd
);
void
setIgd
(
const
std
::
shared_ptr
<
IGD
>&
igd
);
void
setAvailable
(
bool
val
);
void
setAvailable
(
bool
val
);
void
setState
(
const
MappingState
&
state
);
void
setState
(
const
MappingState
&
state
);
void
updateState
(
const
MappingState
&
state
,
bool
notify
=
true
);
void
updateDescription
();
void
updateDescription
();
#if HAVE_LIBNATPMP
#if HAVE_LIBNATPMP
void
setRenewalTime
(
sys_clock
::
time_point
time
);
void
setRenewalTime
(
sys_clock
::
time_point
time
);
...
...
This diff is collapsed.
Click to expand it.
src/upnp/protocol/mapping.cpp
+
0
−
14
View file @
56740314
...
@@ -96,20 +96,6 @@ Mapping::setState(const MappingState& state)
...
@@ -96,20 +96,6 @@ Mapping::setState(const MappingState& state)
state_
=
state
;
state_
=
state
;
}
}
void
Mapping
::
updateState
(
const
MappingState
&
newState
,
bool
notify
)
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
mutex_
);
if
(
newState
==
state_
)
return
;
state_
=
newState
;
if
(
notify
&&
notifyCb_
)
{
lock
.
unlock
();
notifyCb_
(
shared_from_this
());
}
}
const
char
*
const
char
*
Mapping
::
getStateStr
()
const
Mapping
::
getStateStr
()
const
{
{
...
...
This diff is collapsed.
Click to expand it.
src/upnp/upnp_context.cpp
+
1
−
1
View file @
56740314
...
@@ -847,7 +847,7 @@ UPnPContext::pruneMappingsWithInvalidIgds(const std::shared_ptr<IGD>& igd)
...
@@ -847,7 +847,7 @@ UPnPContext::pruneMappingsWithInvalidIgds(const std::shared_ptr<IGD>& igd)
map
->
toString
(),
map
->
toString
(),
igd
->
toString
(),
igd
->
toString
(),
igd
->
getProtocolName
());
igd
->
getProtocolName
());
map
->
updateState
(
MappingState
::
FAILED
);
update
Mapping
State
(
map
,
MappingState
::
FAILED
);
unregisterMapping
(
map
);
unregisterMapping
(
map
);
}
}
}
}
...
...
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