Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
87
Issues
87
List
Boards
Labels
Milestones
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
a2589498
Commit
a2589498
authored
Aug 19, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pupnp: don't block on futures on connectivity change
Change-Id: I4e05d780481c340e288fcbb56898f30fb40bf90c
parent
24bbdc57
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
src/upnp/protocol/pupnp/pupnp.cpp
src/upnp/protocol/pupnp/pupnp.cpp
+11
-3
src/upnp/protocol/pupnp/pupnp.h
src/upnp/protocol/pupnp/pupnp.h
+2
-1
No files found.
src/upnp/protocol/pupnp/pupnp.cpp
View file @
a2589498
...
...
@@ -171,8 +171,8 @@ PUPnP::PUPnP()
}
lk
.
lock
();
// Move back
failed items to end of
list
dwnldlXmlList_
.
splice
(
dwnldlXmlList_
.
end
(),
xmlList
);
// Move back
timed-out items to
list
dwnldlXmlList_
.
splice
(
dwnldlXmlList_
.
begin
(),
xmlList
);
// Handle successful downloads
for
(
auto
&
item
:
finished
)
{
auto
result
=
item
.
get
();
...
...
@@ -181,6 +181,13 @@ PUPnP::PUPnP()
}
}
}
for
(
auto
it
=
cancelXmlList_
.
begin
();
it
!=
cancelXmlList_
.
end
();)
{
if
(
it
->
wait_for
(
std
::
chrono
::
seconds
(
0
))
==
std
::
future_status
::
ready
)
{
it
=
cancelXmlList_
.
erase
(
it
);
}
else
{
++
it
;
}
}
}
}
...
...
@@ -201,6 +208,7 @@ PUPnP::~PUPnP()
validIgdList_
.
clear
();
cpDeviceList_
.
clear
();
dwnldlXmlList_
.
clear
();
cancelXmlList_
.
clear
();
}
// Notify thread to terminate. UpnpFinish function will get called.
...
...
@@ -217,7 +225,7 @@ PUPnP::clearIgds()
std
::
lock_guard
<
std
::
mutex
>
lk
(
validIgdMutex_
);
// Clear all internal lists.
dwnldlXmlList_
.
clear
(
);
cancelXmlList_
.
splice
(
cancelXmlList_
.
end
(),
dwnldlXmlList_
);
validIgdList_
.
clear
();
cpDeviceList_
.
clear
();
}
...
...
src/upnp/protocol/pupnp/pupnp.h
View file @
a2589498
...
...
@@ -147,7 +147,8 @@ 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
<
pIGDInfo
>>
dwnldlXmlList_
;
// List of shared_futures for blocking xml download function calls.
std
::
list
<
std
::
future
<
pIGDInfo
>>
dwnldlXmlList_
;
// List of futures for blocking xml download function calls.
std
::
list
<
std
::
future
<
pIGDInfo
>>
cancelXmlList_
;
// List of abandoned documents
std
::
mutex
ctrlptMutex_
;
// Mutex for client handle protection.
UpnpClient_Handle
ctrlptHandle_
{
-
1
};
// Control point handle.
...
...
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