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
cd512073
Commit
cd512073
authored
May 30, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upnp: unlock mutex after use, cleanup
Change-Id: I9b440d96fc34e9442b7856e428190cc8110f6bfa
parent
852bd075
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/upnp/upnp_context.cpp
src/upnp/upnp_context.cpp
+3
-3
No files found.
src/upnp/upnp_context.cpp
View file @
cd512073
...
...
@@ -958,7 +958,7 @@ UPnPContext::handleUPnPEvents(Upnp_EventType event_type, const void* event)
JAMI_DBG("UPnP: CP received a discovery search result"); */
/* check if we are already in the process of checking this device */
std
::
lock_guard
<
std
::
mutex
>
lock
(
cpDeviceMutex_
);
std
::
unique_lock
<
std
::
mutex
>
lock
(
cpDeviceMutex_
);
/*
* Check if this device ID is already in the list. If we reach the past-the-end
...
...
@@ -969,6 +969,7 @@ UPnPContext::handleUPnPEvents(Upnp_EventType event_type, const void* event)
if
(
it
==
cpDevices_
.
end
())
{
JAMI_DBG
(
"PUPnP: New device ID found -> %s."
,
deviceId
.
c_str
());
cpDevices_
.
emplace
(
deviceId
);
lock
.
unlock
();
if
(
UpnpDiscovery_get_ErrCode
(
d_event
)
!=
UPNP_E_SUCCESS
)
JAMI_WARN
(
"UPnP: Error in discovery event received by the CP: %s"
,
...
...
@@ -996,7 +997,7 @@ UPnPContext::handleUPnPEvents(Upnp_EventType event_type, const void* event)
}
else
{
parseDevice
(
desc_doc
.
get
(),
d_event
);
}
}
}
}
break
;
...
...
@@ -1011,7 +1012,6 @@ UPnPContext::handleUPnPEvents(Upnp_EventType event_type, const void* event)
JAMI_WARN
(
"UPnP: Error in ByeBye received by the CP: %s"
,
UpnpGetErrorMessage
(
UpnpDiscovery_get_ErrCode
(
d_event
)));
/* TODO: check if its a device we care about and remove it from the relevant lists */
std
::
lock_guard
<
std
::
mutex
>
lock
(
cpDeviceMutex_
);
std
::
string
deviceId
(
UpnpDiscovery_get_DeviceID_cstr
(
d_event
));
cpDevices_
.
erase
(
deviceId
);
...
...
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