Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
de87ae90
Commit
de87ae90
authored
Aug 18, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sips_transport_ice: start thread when connected
Change-Id: I5d6c119143c6eec64724226b3a2d5ebe279e0406
parent
58b78449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
src/jamidht/sips_transport_ice.cpp
src/jamidht/sips_transport_ice.cpp
+13
-11
No files found.
src/jamidht/sips_transport_ice.cpp
View file @
de87ae90
...
...
@@ -249,16 +249,6 @@ SipsIceTransport::SipsIceTransport(pjsip_endpoint* endpt,
if
(
pjsip_transport_register
(
base
.
tpmgr
,
&
base
)
!=
PJ_SUCCESS
)
throw
std
::
runtime_error
(
"Can't register PJSIP transport."
);
if
(
PJSIP_TRANSPORT_IS_RELIABLE
(
&
trData_
.
base
))
{
eventLoop_
=
std
::
thread
([
this
]
{
try
{
eventLoop
();
}
catch
(
const
std
::
exception
&
e
)
{
JAMI_ERR
()
<<
"SipIceTransport: eventLoop() failure: "
<<
e
.
what
();
}
});
}
}
SipsIceTransport
::~
SipsIceTransport
()
...
...
@@ -312,12 +302,24 @@ SipsIceTransport::handleEvents()
for
(
auto
&
evdata
:
eventDataQueue
)
{
evdata
.
tls_info
.
ssl_sock_info
=
&
evdata
.
ssl_info
;
evdata
.
state_info
.
ext_info
=
&
evdata
.
tls_info
;
if
(
evdata
.
state
==
PJSIP_TP_STATE_CONNECTED
)
{
if
(
PJSIP_TRANSPORT_IS_RELIABLE
(
&
trData_
.
base
))
{
eventLoop_
=
std
::
thread
([
this
]
{
try
{
eventLoop
();
}
catch
(
const
std
::
exception
&
e
)
{
JAMI_ERR
()
<<
"SipIceTransport: eventLoop() failure: "
<<
e
.
what
();
}
});
}
}
if
(
evdata
.
state
!=
PJSIP_TP_STATE_DISCONNECTED
)
{
(
*
state_cb
)(
&
trData_
.
base
,
evdata
.
state
,
&
evdata
.
state_info
);
}
else
{
JAMI_WARN
(
"[SIPS] got disconnected event!"
);
disconnectedEvent
=
std
::
move
(
evdata
);
disconnected
=
true
;
stopLoop_
=
true
;
break
;
}
}
...
...
@@ -410,7 +412,7 @@ SipsIceTransport::pushChangeStateEvent(ChangeStateEventData&& ev)
// - DO NOT BLOCK - (Called in TlsSession thread)
void
SipsIceTransport
::
onTlsStateChange
(
UNUSED
TlsSessionState
state
)
SipsIceTransport
::
onTlsStateChange
(
TlsSessionState
state
)
{
if
(
state
==
TlsSessionState
::
ESTABLISHED
)
updateTransportState
(
PJSIP_TP_STATE_CONNECTED
);
...
...
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