Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
d1d064d8
Commit
d1d064d8
authored
Apr 10, 2019
by
Sébastien Blin
Browse files
data_transfer: clear map when id is not used anymore
Change-Id: I635ec67b90fc1ae90556a208f451750ceebbfeaa
parent
ecf198bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/data_transfer.cpp
View file @
d1d064d8
...
...
@@ -740,6 +740,12 @@ DataTransferFacade::cancel(const DRing::DataTransferId& id) noexcept
return
DRing
::
DataTransferError
::
invalid_argument
;
}
void
DataTransferFacade
::
close
(
const
DRing
::
DataTransferId
&
id
)
noexcept
{
pimpl_
->
map_
.
erase
(
id
);
}
DRing
::
DataTransferError
DataTransferFacade
::
bytesProgress
(
const
DRing
::
DataTransferId
&
id
,
int64_t
&
total
,
int64_t
&
progress
)
const
noexcept
...
...
src/data_transfer.h
View file @
d1d064d8
...
...
@@ -54,7 +54,10 @@ public:
int64_t
offset
)
noexcept
;
/// \see DRing::cancelDataTransfer
DRing
::
DataTransferError
cancel
(
const
DRing
::
DataTransferId
&
id
)
noexcept
;
DRing
::
DataTransferError
cancel
(
const
DRing
::
DataTransferId
&
id
)
noexcept
;
/// Used by p2p.cpp
void
close
(
const
DRing
::
DataTransferId
&
id
)
noexcept
;
/// \see DRing::dataTransferInfo
DRing
::
DataTransferError
info
(
const
DRing
::
DataTransferId
&
id
,
...
...
src/jamidht/p2p.cpp
View file @
d1d064d8
...
...
@@ -884,6 +884,7 @@ DhtPeerConnector::Impl::eventLoop()
element
.
second
->
hasStreamWithId
(
id
));
});
if
(
it
==
servers_
.
end
())
{
Manager
::
instance
().
dataTransfers
->
close
(
id
);
break
;
}
auto
peer
=
it
->
first
.
second
;
// tmp copy to prevent use-after-free below
...
...
@@ -899,6 +900,7 @@ DhtPeerConnector::Impl::eventLoop()
connectedPeers_
.
erase
(
peer
);
// Else it's via TURN!
turnEndpoints_
.
erase
(
peer
);
Manager
::
instance
().
dataTransfers
->
close
(
id
);
}
break
;
...
...
Write
Preview
Supports
Markdown
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