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
9e8037e8
Commit
9e8037e8
authored
Jul 14, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up proxy killing in BASP
parent
adc11fec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
23 deletions
+9
-23
libcaf_io/caf/io/basp/instance.hpp
libcaf_io/caf/io/basp/instance.hpp
+0
-5
libcaf_io/caf/io/basp_broker.hpp
libcaf_io/caf/io/basp_broker.hpp
+0
-3
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+7
-14
libcaf_io/src/instance.cpp
libcaf_io/src/instance.cpp
+2
-1
No files found.
libcaf_io/caf/io/basp/instance.hpp
View file @
9e8037e8
...
...
@@ -63,11 +63,6 @@ public:
/// for one of our local actors.
virtual
void
proxy_announced
(
const
node_id
&
nid
,
actor_id
aid
)
=
0
;
/// Called whenever a remote actor died to destroy
/// the proxy instance on our end.
virtual
void
kill_proxy
(
const
node_id
&
nid
,
actor_id
aid
,
const
error
&
rsn
)
=
0
;
/// Called for each `dispatch_message` without `named_receiver_flag`.
virtual
void
deliver
(
const
node_id
&
source_node
,
actor_id
source_actor
,
actor_id
dest_actor
,
message_id
mid
,
...
...
libcaf_io/caf/io/basp_broker.hpp
View file @
9e8037e8
...
...
@@ -62,9 +62,6 @@ struct basp_broker_state : proxy_registry::backend, basp::instance::callee {
// inherited from basp::instance::listener
void
proxy_announced
(
const
node_id
&
nid
,
actor_id
aid
)
override
;
// inherited from basp::instance::listener
void
kill_proxy
(
const
node_id
&
nid
,
actor_id
aid
,
const
error
&
rsn
)
override
;
// inherited from basp::instance::listener
void
deliver
(
const
node_id
&
src_nid
,
actor_id
src_aid
,
actor_id
dest_aid
,
message_id
mid
,
...
...
libcaf_io/src/basp_broker.cpp
View file @
9e8037e8
...
...
@@ -159,7 +159,7 @@ void basp_broker_state::purge_state(const node_id& nid) {
}
ctx
.
erase
(
i
);
}
proxies
().
erase
(
nid
);
self
->
close
(
hdl
);
}
void
basp_broker_state
::
proxy_announced
(
const
node_id
&
nid
,
actor_id
aid
)
{
...
...
@@ -200,12 +200,6 @@ void basp_broker_state::proxy_announced(const node_id& nid, actor_id aid) {
}
}
void
basp_broker_state
::
kill_proxy
(
const
node_id
&
nid
,
actor_id
aid
,
const
error
&
rsn
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
nid
)
<<
CAF_ARG
(
aid
)
<<
CAF_ARG
(
rsn
));
proxies
().
erase
(
nid
,
aid
,
rsn
);
}
void
basp_broker_state
::
deliver
(
const
node_id
&
src_nid
,
actor_id
src_aid
,
actor_id
dest_aid
,
message_id
mid
,
std
::
vector
<
strong_actor_ptr
>&
stages
,
...
...
@@ -520,14 +514,13 @@ behavior basp_broker::make_behavior() {
auto
next
=
state
.
instance
.
handle
(
context
(),
msg
,
ctx
.
hdr
,
ctx
.
cstate
==
basp
::
await_payload
);
if
(
next
==
basp
::
close_connection
)
{
if
(
ctx
.
callback
)
{
CAF_LOG_WARNING
(
"failed to handshake with remote node"
<<
CAF_ARG
(
msg
.
handle
));
ctx
.
callback
->
deliver
(
make_error
(
sec
::
disconnect_during_handshake
));
}
// The function `instance::handle` calls purge_state. All state has
// been cleaned up at this stage. In particular, accessing this_context
// results in a heap-use-after-free error.
close
(
msg
.
handle
);
state
.
ctx
.
erase
(
msg
.
handle
);
}
else
if
(
next
!=
ctx
.
cstate
)
{
return
;
}
if
(
next
!=
ctx
.
cstate
)
{
auto
rd_size
=
next
==
basp
::
await_payload
?
ctx
.
hdr
.
payload_len
:
basp
::
header_size
;
...
...
libcaf_io/src/instance.cpp
View file @
9e8037e8
...
...
@@ -237,7 +237,8 @@ connection_state instance::handle(execution_unit* ctx,
auto
e
=
bd
(
fail_state
);
if
(
e
)
return
err
();
callee_
.
kill_proxy
(
hdr
.
source_node
,
hdr
.
source_actor
,
fail_state
);
callee_
.
proxies
().
erase
(
hdr
.
source_node
,
hdr
.
source_actor
,
std
::
move
(
fail_state
));
break
;
}
case
message_type
:
:
heartbeat
:
{
...
...
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