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
2d653ee5
Commit
2d653ee5
authored
Jun 30, 2021
by
Sébastien Blin
Browse files
data_transfer: directly pass the buffer
Change-Id: I62f93b4b0706863debc9595b0b4646c3b0974b52
parent
0e6cc9c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/data_transfer.cpp
View file @
2d653ee5
...
...
@@ -832,15 +832,15 @@ IncomingFile::cancel()
void
IncomingFile
::
process
()
{
channel_
->
setOnRecv
([
w
=
weak
()](
const
uint8_t
*
buf
,
size_t
len
)
{
channel_
->
setOnRecv
([
w
=
weak
()](
const
uint8_t
*
buf
,
size_t
len
)
{
if
(
auto
shared
=
w
.
lock
())
{
if
(
shared
->
stream_
.
is_open
())
shared
->
stream_
<<
std
::
string_view
((
const
char
*
)
buf
,
len
);
shared
->
stream_
.
write
(
reinterpret_cast
<
const
char
*
>
(
buf
)
,
len
);
shared
->
info_
.
bytesProgress
=
shared
->
stream_
.
tellp
();
}
return
len
;
});
channel_
->
onShutdown
([
w
=
weak
()]
{
channel_
->
onShutdown
([
w
=
weak
()]
{
auto
shared
=
w
.
lock
();
if
(
!
shared
)
return
;
...
...
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