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
6be3b469
Commit
6be3b469
authored
2 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
connectionmanager: remove unwanted re-schedule on IO pool
Change-Id: Ic2f1cf4151e55f5f6a1fc18c857c90143656ad35
parent
120eb26b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/jamidht/connectionmanager.cpp
+43
-51
43 additions, 51 deletions
src/jamidht/connectionmanager.cpp
with
43 additions
and
51 deletions
src/jamidht/connectionmanager.cpp
+
43
−
51
View file @
6be3b469
...
...
@@ -317,14 +317,15 @@ ConnectionManager::Impl::connectDeviceStartIce(
// Send connection request through DHT
JAMI_DBG
()
<<
account
<<
"Request connection to "
<<
deviceId
;
account
.
dht
()
->
putEncrypted
(
dht
::
InfoHash
::
get
(
PeerConnectionRequest
::
key_prefix
+
devicePk
->
getId
().
toString
()),
account
.
dht
()
->
putEncrypted
(
dht
::
InfoHash
::
get
(
PeerConnectionRequest
::
key_prefix
+
devicePk
->
getId
().
toString
()),
devicePk
,
value
,
[
deviceId
](
bool
ok
)
{
if
(
!
ok
)
JAMI_ERR
(
"Tried to send request to %s, but put failed"
,
deviceId
.
to_c_str
());
[
deviceId
,
accId
=
account
.
getAccountID
()](
bool
ok
)
{
JAMI_DEBUG
(
"[Account {:s}] Send connection request to {:s}. Put encrypted {:s}"
,
accId
,
deviceId
.
toString
(),
(
ok
?
"ok"
:
"failed"
));
});
// Wait for call to onResponse() operated by DHT
if
(
isDestroying_
)
...
...
@@ -682,16 +683,6 @@ ConnectionManager::Impl::onDhtConnected(const dht::crypto::PublicKey& devicePk)
}
else
{
JAMI_DBG
()
<<
"Received request from "
<<
req
.
owner
->
getLongId
();
}
// Hack:
// Note: This reschedule on the io pool should not be necessary
// however https://git.jami.net/savoirfairelinux/ring-daemon/-/issues/421
// is a bit clueless and not reproductible in a debug env for now. However,
// the behavior makes me think this callback is blocked (maybe in getInfos())
// and this must never happen.
dht
::
ThreadPool
::
io
().
run
([
w
,
req
=
std
::
move
(
req
)]
{
auto
shared
=
w
.
lock
();
if
(
!
shared
)
return
;
if
(
req
.
isAnswer
)
{
shared
->
onPeerResponse
(
req
);
}
else
{
...
...
@@ -706,7 +697,8 @@ ConnectionManager::Impl::onDhtConnected(const dht::crypto::PublicKey& devicePk)
dht
::
InfoHash
peer_h
;
if
(
AccountManager
::
foundPeerDevice
(
cert
,
peer_h
))
{
#if TARGET_OS_IOS
if
((
req
.
connType
==
"videoCall"
||
req
.
connType
==
"audioCall"
)
&&
jami
::
Manager
::
instance
().
isIOSExtension
)
{
if
((
req
.
connType
==
"videoCall"
||
req
.
connType
==
"audioCall"
)
&&
jami
::
Manager
::
instance
().
isIOSExtension
)
{
bool
hasVideo
=
req
.
connType
==
"videoCall"
;
emitSignal
<
DRing
::
ConversationSignal
::
CallConnectionRequest
>
(
shared
->
account
.
getAccountID
(),
peer_h
.
toString
(),
hasVideo
);
...
...
@@ -715,13 +707,12 @@ ConnectionManager::Impl::onDhtConnected(const dht::crypto::PublicKey& devicePk)
#endif
shared
->
onDhtPeerRequest
(
req
,
cert
);
}
else
{
JAMI_WARN
()
<<
shared
->
account
<<
"Rejected untrusted connection request from "
JAMI_WARN
()
<<
shared
->
account
<<
"Rejected untrusted connection request from "
<<
req
.
owner
->
getLongId
();
}
});
}
});
return
true
;
},
...
...
@@ -805,10 +796,11 @@ ConnectionManager::Impl::answerTo(IceTransport& ice,
dht
::
InfoHash
::
get
(
PeerConnectionRequest
::
key_prefix
+
from
->
getId
().
toString
()),
from
,
value
,
[
from
](
bool
ok
)
{
if
(
!
ok
)
JAMI_ERR
(
"Tried to answer to connection request from %s, but put failed"
,
from
->
getLongId
().
to_c_str
());
[
from
,
accId
=
account
.
getAccountID
()](
bool
ok
)
{
JAMI_DEBUG
(
"[Account {:s}] Answer to connection request from {:s}. Put encrypted {:s}"
,
accId
,
from
->
getLongId
().
toString
(),
(
ok
?
"ok"
:
"failed"
));
});
}
...
...
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