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
7201cc52
Commit
7201cc52
authored
10 years ago
by
Adrien Béraud
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sips/ice: properly report all incoming packets before closing
Refs #69371 Change-Id: Ife39e493848f1326234d25f657b49734e8ce0b1d
parent
255d7877
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ringdht/sips_transport_ice.cpp
+34
-24
34 additions, 24 deletions
src/ringdht/sips_transport_ice.cpp
src/ringdht/sips_transport_ice.h
+1
-0
1 addition, 0 deletions
src/ringdht/sips_transport_ice.h
with
35 additions
and
24 deletions
src/ringdht/sips_transport_ice.cpp
+
34
−
24
View file @
7201cc52
...
...
@@ -658,6 +658,7 @@ SipsIceTransport::setup()
void
SipsIceTransport
::
handleEvents
()
{
{
std
::
lock_guard
<
std
::
mutex
>
l
(
rxMtx_
);
while
(
not
rxPending_
.
empty
())
{
...
...
@@ -686,6 +687,8 @@ SipsIceTransport::handleEvents()
}
}
}
rxCv_
.
notify_all
();
}
void
SipsIceTransport
::
loop
()
...
...
@@ -766,7 +769,7 @@ SipsIceTransport::loop()
rxPending_
.
splice
(
rxPending_
.
end
(),
rxPendingPool_
,
rxPendingPool_
.
begin
());
}
else
if
(
decrypted_size
==
0
)
{
/* EOF */
shutdown
();
tlsThread_
.
stop
();
break
;
}
else
if
(
decrypted_size
==
GNUTLS_E_AGAIN
or
decrypted_size
==
GNUTLS_E_INTERRUPTED
)
{
...
...
@@ -821,7 +824,14 @@ SipsIceTransport::clean()
cookie_key_
.
data
=
nullptr
;
cookie_key_
.
size
=
0
;
}
{
// make sure all incoming packets are reported before closing
std
::
unique_lock
<
std
::
mutex
>
l
(
rxMtx_
);
rxCv_
.
wait
(
l
,
[
&
](){
return
rxPending_
.
empty
();
});
rxPendingPool_
.
clear
();
}
bool
event
=
state_
==
TlsConnectionState
::
ESTABLISHED
;
closeTlsSession
();
...
...
This diff is collapsed.
Click to expand it.
src/ringdht/sips_transport_ice.h
+
1
−
0
View file @
7201cc52
...
...
@@ -164,6 +164,7 @@ private:
std
::
mutex
outputBuffMtx_
;
std
::
mutex
rxMtx_
;
std
::
condition_variable_any
rxCv_
;
std
::
list
<
std
::
vector
<
uint8_t
>>
rxPending_
;
std
::
list
<
std
::
vector
<
uint8_t
>>
rxPendingPool_
;
pjsip_rx_data
rdata_
;
...
...
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