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
66336ccb
Unverified
Commit
66336ccb
authored
4 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
ice: stop send if destroyed
Change-Id: Icfe920a562f1b255a1371544775bae12dcb539c7
parent
2d1fa7ca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ice_transport.cpp
+6
-1
6 additions, 1 deletion
src/ice_transport.cpp
with
6 additions
and
1 deletion
src/ice_transport.cpp
+
6
−
1
View file @
66336ccb
...
...
@@ -196,6 +196,7 @@ public:
pj_ssize_t
lastSentLen_
;
std
::
condition_variable
waitDataCv_
=
{};
std
::
atomic_bool
destroying_
{
false
};
onShutdownCb
scb
;
// Default remote adresses
...
...
@@ -386,6 +387,8 @@ IceTransport::Impl::Impl(const char* name,
icecb
.
on_destroy
=
[](
pj_ice_strans
*
ice_st
)
{
if
(
auto
*
tr
=
static_cast
<
Impl
*>
(
pj_ice_strans_get_user_data
(
ice_st
)))
{
tr
->
destroying_
=
true
;
tr
->
waitDataCv_
.
notify_all
();
if
(
tr
->
scb
)
tr
->
scb
();
}
else
{
...
...
@@ -1449,7 +1452,9 @@ IceTransport::send(int comp_id, const unsigned char* buf, size_t len)
// NOTE; because we are in TCP, the sent size will count the header (2
// bytes length).
std
::
unique_lock
<
std
::
mutex
>
lk
(
pimpl_
->
iceMutex_
);
pimpl_
->
waitDataCv_
.
wait
(
lk
,
[
&
]
{
return
pimpl_
->
lastSentLen_
>=
len
;
});
pimpl_
->
waitDataCv_
.
wait
(
lk
,
[
&
]
{
return
pimpl_
->
lastSentLen_
>=
len
or
pimpl_
->
destroying_
.
load
();
});
pimpl_
->
lastSentLen_
=
0
;
}
else
if
(
status
!=
PJ_SUCCESS
&&
status
!=
PJ_EPENDING
)
{
if
(
status
==
PJ_EBUSY
)
{
...
...
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