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
Automate
Agent sessions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
d6d2c9b3
Commit
d6d2c9b3
authored
Oct 19, 2020
by
Sébastien Blin
Committed by
Adrien Béraud
Oct 21, 2020
Browse files
Options
Downloads
Patches
Plain Diff
jamiaccount: add lock for incomingFileTransfers_
Change-Id: Icff5822193aea4b99437ce110c7d4fc503112fe6
parent
c72b8978
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/jamidht/jamiaccount.cpp
+3
-0
3 additions, 0 deletions
src/jamidht/jamiaccount.cpp
src/jamidht/jamiaccount.h
+1
-0
1 addition, 0 deletions
src/jamidht/jamiaccount.h
with
4 additions
and
0 deletions
src/jamidht/jamiaccount.cpp
+
3
−
0
View file @
d6d2c9b3
...
@@ -2190,6 +2190,7 @@ JamiAccount::doRegister_()
...
@@ -2190,6 +2190,7 @@ JamiAccount::doRegister_()
std
::
istringstream
iss
(
tid_str
);
std
::
istringstream
iss
(
tid_str
);
iss
>>
tid
;
iss
>>
tid
;
if
(
dhtPeerConnector_
->
onIncomingChannelRequest
(
tid
))
{
if
(
dhtPeerConnector_
->
onIncomingChannelRequest
(
tid
))
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
transfersMtx_
);
incomingFileTransfers_
.
emplace
(
tid_str
);
incomingFileTransfers_
.
emplace
(
tid_str
);
return
true
;
return
true
;
}
}
...
@@ -2210,11 +2211,13 @@ JamiAccount::doRegister_()
...
@@ -2210,11 +2211,13 @@ JamiAccount::doRegister_()
cacheSIPConnection
(
std
::
move
(
channel
),
peerId
,
deviceId
);
cacheSIPConnection
(
std
::
move
(
channel
),
peerId
,
deviceId
);
}
else
if
(
isFile
or
isVCard
)
{
}
else
if
(
isFile
or
isVCard
)
{
auto
tid_str
=
isFile
?
name
.
substr
(
7
)
:
name
.
substr
(
8
);
auto
tid_str
=
isFile
?
name
.
substr
(
7
)
:
name
.
substr
(
8
);
std
::
unique_lock
<
std
::
mutex
>
lk
(
transfersMtx_
);
auto
it
=
incomingFileTransfers_
.
find
(
tid_str
);
auto
it
=
incomingFileTransfers_
.
find
(
tid_str
);
// Note, outgoing file transfers are ignored.
// Note, outgoing file transfers are ignored.
if
(
it
==
incomingFileTransfers_
.
end
())
if
(
it
==
incomingFileTransfers_
.
end
())
return
;
return
;
incomingFileTransfers_
.
erase
(
it
);
incomingFileTransfers_
.
erase
(
it
);
lk
.
unlock
();
uint64_t
tid
;
uint64_t
tid
;
std
::
istringstream
iss
(
tid_str
);
std
::
istringstream
iss
(
tid_str
);
iss
>>
tid
;
iss
>>
tid
;
...
...
This diff is collapsed.
Click to expand it.
src/jamidht/jamiaccount.h
+
1
−
0
View file @
d6d2c9b3
...
@@ -751,6 +751,7 @@ private:
...
@@ -751,6 +751,7 @@ private:
const
DeviceId
&
deviceId
);
const
DeviceId
&
deviceId
);
// File transfers
// File transfers
std
::
mutex
transfersMtx_
{};
std
::
set
<
std
::
string
>
incomingFileTransfers_
{};
std
::
set
<
std
::
string
>
incomingFileTransfers_
{};
/**
/**
...
...
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
sign in
to comment