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
0dabf111
Commit
0dabf111
authored
Jul 15, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wr-op-backoff recovery
parent
227b4ff4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
libcaf_io/src/io/network/stream.cpp
libcaf_io/src/io/network/stream.cpp
+5
-2
No files found.
libcaf_io/src/io/network/stream.cpp
View file @
0dabf111
...
@@ -54,7 +54,7 @@ void stream::write(const void* buf, size_t num_bytes) {
...
@@ -54,7 +54,7 @@ void stream::write(const void* buf, size_t num_bytes) {
void
stream
::
flush
(
const
manager_ptr
&
mgr
)
{
void
stream
::
flush
(
const
manager_ptr
&
mgr
)
{
CAF_ASSERT
(
mgr
!=
nullptr
);
CAF_ASSERT
(
mgr
!=
nullptr
);
CAF_LOG_TRACE
(
CAF_ARG
(
wr_offline_buf_
.
size
()));
CAF_LOG_TRACE
(
CAF_ARG
(
wr_offline_buf_
.
size
()));
if
(
!
wr_offline_buf_
.
empty
()
&&
!
state_
.
writing
)
{
if
(
!
wr_offline_buf_
.
empty
()
&&
!
state_
.
writing
&&
!
wr_op_backoff_
)
{
backend
().
add
(
operation
::
write
,
fd
(),
this
);
backend
().
add
(
operation
::
write
,
fd
(),
this
);
writer_
=
mgr
;
writer_
=
mgr
;
state_
.
writing
=
true
;
state_
.
writing
=
true
;
...
@@ -125,7 +125,7 @@ void stream::prepare_next_write() {
...
@@ -125,7 +125,7 @@ void stream::prepare_next_write() {
CAF_LOG_TRACE
(
CAF_ARG
(
wr_buf_
.
size
())
<<
CAF_ARG
(
wr_offline_buf_
.
size
()));
CAF_LOG_TRACE
(
CAF_ARG
(
wr_buf_
.
size
())
<<
CAF_ARG
(
wr_offline_buf_
.
size
()));
written_
=
0
;
written_
=
0
;
wr_buf_
.
clear
();
wr_buf_
.
clear
();
if
(
wr_offline_buf_
.
empty
())
{
if
(
wr_offline_buf_
.
empty
()
||
wr_op_backoff_
)
{
state_
.
writing
=
false
;
state_
.
writing
=
false
;
backend
().
del
(
operation
::
write
,
fd
(),
this
);
backend
().
del
(
operation
::
write
,
fd
(),
this
);
if
(
state_
.
shutting_down
)
if
(
state_
.
shutting_down
)
...
@@ -147,7 +147,10 @@ bool stream::handle_read_result(rw_state read_result, size_t rb) {
...
@@ -147,7 +147,10 @@ bool stream::handle_read_result(rw_state read_result, size_t rb) {
// Recover previous pending write if it is the first successful read after
// Recover previous pending write if it is the first successful read after
// want_read was reported.
// want_read was reported.
if
(
wr_op_backoff_
)
{
if
(
wr_op_backoff_
)
{
CAF_ASSERT
(
reader_
!=
nullptr
);
backend
().
add
(
operation
::
write
,
fd
(),
this
);
backend
().
add
(
operation
::
write
,
fd
(),
this
);
writer_
=
reader_
;
state_
.
writing
=
true
;
wr_op_backoff_
=
false
;
wr_op_backoff_
=
false
;
}
}
[[
fallthrough
]];
[[
fallthrough
]];
...
...
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