Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
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
Hide 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()
...
@@ -171,8 +171,8 @@ PUPnP::PUPnP()
}
}
lk
.
lock
();
lk
.
lock
();
// Move back
failed items to end of
list
// Move back
timed-out items to
list
dwnldlXmlList_
.
splice
(
dwnldlXmlList_
.
end
(),
xmlList
);
dwnldlXmlList_
.
splice
(
dwnldlXmlList_
.
begin
(),
xmlList
);
// Handle successful downloads
// Handle successful downloads
for
(
auto
&
item
:
finished
)
{
for
(
auto
&
item
:
finished
)
{
auto
result
=
item
.
get
();
auto
result
=
item
.
get
();
...
@@ -181,6 +181,13 @@ PUPnP::PUPnP()
...
@@ -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()
...
@@ -201,6 +208,7 @@ PUPnP::~PUPnP()
validIgdList_
.
clear
();
validIgdList_
.
clear
();
cpDeviceList_
.
clear
();
cpDeviceList_
.
clear
();
dwnldlXmlList_
.
clear
();
dwnldlXmlList_
.
clear
();
cancelXmlList_
.
clear
();
}
}
// Notify thread to terminate. UpnpFinish function will get called.
// Notify thread to terminate. UpnpFinish function will get called.
...
@@ -217,7 +225,7 @@ PUPnP::clearIgds()
...
@@ -217,7 +225,7 @@ PUPnP::clearIgds()
std
::
lock_guard
<
std
::
mutex
>
lk
(
validIgdMutex_
);
std
::
lock_guard
<
std
::
mutex
>
lk
(
validIgdMutex_
);
// Clear all internal lists.
// Clear all internal lists.
dwnldlXmlList_
.
clear
(
);
cancelXmlList_
.
splice
(
cancelXmlList_
.
end
(),
dwnldlXmlList_
);
validIgdList_
.
clear
();
validIgdList_
.
clear
();
cpDeviceList_
.
clear
();
cpDeviceList_
.
clear
();
}
}
...
...
src/upnp/protocol/pupnp/pupnp.h
View file @
a2589498
...
@@ -147,7 +147,8 @@ private:
...
@@ -147,7 +147,8 @@ private:
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
IGD
>>
validIgdList_
;
// Map of valid IGDs with their UDN (universal Id).
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
::
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.
std
::
mutex
ctrlptMutex_
;
// Mutex for client handle protection.
UpnpClient_Handle
ctrlptHandle_
{
-
1
};
// Control point handle.
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