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
a928b44b
Commit
a928b44b
authored
Apr 24, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure data is shipped before closing a socket
parent
e6d467ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
CHANGELOG.md
CHANGELOG.md
+3
-0
libcaf_net/src/net/octet_stream/transport.cpp
libcaf_net/src/net/octet_stream/transport.cpp
+4
-4
No files found.
CHANGELOG.md
View file @
a928b44b
...
@@ -9,6 +9,9 @@ is based on [Keep a Changelog](https://keepachangelog.com).
...
@@ -9,6 +9,9 @@ is based on [Keep a Changelog](https://keepachangelog.com).
-
Fix flow setup for servers that use
`web_socket::with`
. This bug caused
-
Fix flow setup for servers that use
`web_socket::with`
. This bug caused
servers to immediately abort incoming connection (#1402).
servers to immediately abort incoming connection (#1402).
-
Make sure that a protocol stack ships pending data before closing a socket.
This bug prevented clients from receiving error messages from servers if the
server shuts down immediately after writing the message.
## [0.19.0] - 2023-04-17
## [0.19.0] - 2023-04-17
...
...
libcaf_net/src/net/octet_stream/transport.cpp
View file @
a928b44b
...
@@ -214,16 +214,16 @@ void transport::handle_buffered_data() {
...
@@ -214,16 +214,16 @@ void transport::handle_buffered_data() {
auto
delta
=
bytes
.
subspan
(
delta_offset_
);
auto
delta
=
bytes
.
subspan
(
delta_offset_
);
auto
consumed
=
up_
->
consume
(
bytes
,
delta
);
auto
consumed
=
up_
->
consume
(
bytes
,
delta
);
if
(
consumed
<
0
)
{
if
(
consumed
<
0
)
{
// Negative values indicate that the application
encountered an
// Negative values indicate that the application
wants to close the
//
unrecoverable error
.
//
socket. We still make sure to send any pending data before closing
.
up_
->
abort
(
make_error
(
caf
::
sec
::
runtime_error
,
"consumed < 0"
));
up_
->
abort
(
make_error
(
caf
::
sec
::
runtime_error
,
"consumed < 0"
));
parent_
->
deregister
();
parent_
->
deregister
_reading
();
return
;
return
;
}
else
if
(
static_cast
<
size_t
>
(
consumed
)
>
n
)
{
}
else
if
(
static_cast
<
size_t
>
(
consumed
)
>
n
)
{
// Must not happen. An application cannot handle more data then we pass
// Must not happen. An application cannot handle more data then we pass
// to it.
// to it.
up_
->
abort
(
make_error
(
sec
::
logic_error
,
"consumed > buffer.size"
));
up_
->
abort
(
make_error
(
sec
::
logic_error
,
"consumed > buffer.size"
));
parent_
->
deregister
();
parent_
->
deregister
_reading
();
return
;
return
;
}
else
if
(
consumed
==
0
)
{
}
else
if
(
consumed
==
0
)
{
if
(
next_
)
{
if
(
next_
)
{
...
...
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