Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
3c2a2f88
Commit
3c2a2f88
authored
Jun 19, 2018
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix receive buffer size after autoconnect
parent
328abb98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
libcaf_io/src/connection_helper.cpp
libcaf_io/src/connection_helper.cpp
+5
-0
libcaf_io/src/test_multiplexer.cpp
libcaf_io/src/test_multiplexer.cpp
+1
-1
No files found.
libcaf_io/src/connection_helper.cpp
View file @
3c2a2f88
...
@@ -59,8 +59,13 @@ behavior datagram_connection_broker(broker* self,
...
@@ -59,8 +59,13 @@ behavior datagram_connection_broker(broker* self,
return
{
return
{
[
=
](
new_datagram_msg
&
msg
)
{
[
=
](
new_datagram_msg
&
msg
)
{
auto
hdl
=
msg
.
handle
;
auto
hdl
=
msg
.
handle
;
auto
cap
=
msg
.
buf
.
capacity
();
self
->
send
(
system_broker
,
std
::
move
(
msg
),
self
->
take
(
hdl
),
port
);
self
->
send
(
system_broker
,
std
::
move
(
msg
),
self
->
take
(
hdl
),
port
);
self
->
quit
();
self
->
quit
();
// The buffer returned to the multiplexer will have capacity zero
// if we don't do this. Handling this case here is cheaper than
// checking before each receive in the multiplexer.
msg
.
buf
.
reserve
(
cap
);
},
},
after
(
autoconnect_timeout
)
>>
[
=
]()
{
after
(
autoconnect_timeout
)
>>
[
=
]()
{
CAF_LOG_TRACE
(
CAF_ARG
(
""
));
CAF_LOG_TRACE
(
CAF_ARG
(
""
));
...
...
libcaf_io/src/test_multiplexer.cpp
View file @
3c2a2f88
...
@@ -908,7 +908,7 @@ bool test_multiplexer::try_read_data(datagram_handle hdl) {
...
@@ -908,7 +908,7 @@ bool test_multiplexer::try_read_data(datagram_handle hdl) {
auto
&
from
=
rh
.
vn_buf
.
front
();
auto
&
from
=
rh
.
vn_buf
.
front
();
auto
&
to
=
data
->
rd_buf
;
auto
&
to
=
data
->
rd_buf
;
to
.
first
=
from
.
first
;
to
.
first
=
from
.
first
;
CAF_ASSERT
(
to
.
second
.
capacity
()
>
from
.
second
.
size
());
CAF_ASSERT
(
to
.
second
.
capacity
()
>
=
from
.
second
.
size
());
to
.
second
.
resize
(
from
.
second
.
size
());
to
.
second
.
resize
(
from
.
second
.
size
());
std
::
copy
(
from
.
second
.
begin
(),
from
.
second
.
end
(),
to
.
second
.
begin
());
std
::
copy
(
from
.
second
.
begin
(),
from
.
second
.
end
(),
to
.
second
.
begin
());
rh
.
vn_buf
.
pop_front
();
rh
.
vn_buf
.
pop_front
();
...
...
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