Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
a73c77bf
Commit
a73c77bf
authored
5 years ago
by
Andreas Traczyk
Browse files
Options
Downloads
Patches
Plain Diff
upnp: fix C3853 with microsoft compiler
Change-Id: I6da65c9b61ea0def790710cb55120c0dab632fda
parent
1a3ab76f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/upnp/protocol/pupnp/pupnp.cpp
+6
-6
6 additions, 6 deletions
src/upnp/protocol/pupnp/pupnp.cpp
src/upnp/protocol/pupnp/pupnp.h
+2
-1
2 additions, 1 deletion
src/upnp/protocol/pupnp/pupnp.h
with
8 additions
and
7 deletions
src/upnp/protocol/pupnp/pupnp.cpp
+
6
−
6
View file @
a73c77bf
...
...
@@ -176,8 +176,8 @@ PUPnP::PUPnP()
// Handle successful downloads
for
(
auto
&
item
:
finished
)
{
auto
result
=
item
.
get
();
if
(
not
result
.
document
or
not
validateIgd
(
result
))
{
cpDeviceList_
.
erase
(
result
.
location
);
if
(
not
result
->
document
or
not
validateIgd
(
*
result
))
{
cpDeviceList_
.
erase
(
result
->
location
);
}
}
}
...
...
@@ -449,7 +449,7 @@ PUPnP::handleCtrlPtUPnPEvents(Upnp_EventType event_type, const void* event)
// Check if we already downloaded the xml doc based on the igd location string.
std
::
string
igdLocationUrl
{
UpnpDiscovery_get_Location_cstr
(
d_event
)};
dwnldlXmlList_
.
emplace_back
(
dht
::
ThreadPool
::
io
().
get
<
IGDInfo
>
([
this
,
location
=
std
::
move
(
igdLocationUrl
)]{
dwnldlXmlList_
.
emplace_back
(
dht
::
ThreadPool
::
io
().
get
<
p
IGDInfo
>
([
this
,
location
=
std
::
move
(
igdLocationUrl
)]{
IXML_Document
*
doc_container_ptr
=
nullptr
;
XMLDocument
doc_desc_ptr
(
nullptr
,
ixmlDocument_free
);
int
upnp_err
=
UpnpDownloadXmlDoc
(
location
.
c_str
(),
&
doc_container_ptr
);
...
...
@@ -459,8 +459,8 @@ PUPnP::handleCtrlPtUPnPEvents(Upnp_EventType event_type, const void* event)
if
(
upnp_err
!=
UPNP_E_SUCCESS
or
not
doc_desc_ptr
)
JAMI_WARN
(
"PUPnP: Error downloading device XML document -> %s"
,
UpnpGetErrorMessage
(
upnp_err
));
else
return
IGDInfo
{
std
::
move
(
location
),
std
::
move
(
doc_desc_ptr
)
}
;
return
IGDInfo
{
std
::
move
(
location
),
XMLDocument
(
nullptr
,
ixmlDocument_free
)
}
;
return
std
::
make_unique
<
IGDInfo
>
(
IGDInfo
{
std
::
move
(
location
),
std
::
move
(
doc_desc_ptr
)
})
;
return
std
::
make_unique
<
IGDInfo
>
(
IGDInfo
{
std
::
move
(
location
),
XMLDocument
(
nullptr
,
ixmlDocument_free
)
})
;
}));
break
;
...
...
@@ -925,4 +925,4 @@ PUPnP::actionAddPortMapping(const UPnPIGD& igd, const Mapping& mapping, UPnPProt
return
true
;
}
}}
// namespace jami::upnp
\ No newline at end of file
}}
// namespace jami::upnp
This diff is collapsed.
Click to expand it.
src/upnp/protocol/pupnp/pupnp.h
+
2
−
1
View file @
a73c77bf
...
...
@@ -79,6 +79,7 @@ public:
std
::
string
location
;
XMLDocument
document
;
};
using
pIGDInfo
=
std
::
unique_ptr
<
IGDInfo
>
;
PUPnP
();
~
PUPnP
();
...
...
@@ -146,7 +147,7 @@ private:
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
IGD
>>
validIgdList_
;
// Map of valid IGDs with their UDN (universal Id).
std
::
set
<
std
::
string
>
cpDeviceList_
;
// Control point device list containing the device ID and device subscription event url.
std
::
list
<
std
::
future
<
IGDInfo
>>
dwnldlXmlList_
;
// List of shared_futures for blocking xml download function calls.
std
::
list
<
std
::
future
<
p
IGDInfo
>>
dwnldlXmlList_
;
// List of shared_futures for blocking xml download function calls.
std
::
mutex
ctrlptMutex_
;
// Mutex for client handle protection.
UpnpClient_Handle
ctrlptHandle_
{
-
1
};
// Control point handle.
...
...
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