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
a0f1066c
Commit
a0f1066c
authored
Mar 09, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #440 from ufownl/topic/fix_basp_issue
Fix BASP handshake issue
parents
8cd93e91
bbd1e3a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
libcaf_io/src/basp.cpp
libcaf_io/src/basp.cpp
+5
-5
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+8
-0
libcaf_io/src/middleman_actor.cpp
libcaf_io/src/middleman_actor.cpp
+2
-1
No files found.
libcaf_io/src/basp.cpp
View file @
a0f1066c
...
@@ -342,14 +342,14 @@ connection_state instance::handle(execution_unit* ctx,
...
@@ -342,14 +342,14 @@ connection_state instance::handle(execution_unit* ctx,
}
else
{
}
else
{
binary_deserializer
bd
{
ctx
,
dm
.
buf
.
data
(),
dm
.
buf
.
size
()};
binary_deserializer
bd
{
ctx
,
dm
.
buf
.
data
(),
dm
.
buf
.
size
()};
bd
>>
hdr
;
bd
>>
hdr
;
CAF_LOG_DEBUG
(
CAF_ARG
(
hdr
));
if
(
!
valid
(
hdr
))
{
CAF_LOG_WARNING
(
"received invalid header:"
<<
CAF_ARG
(
hdr
.
operation
));
return
err
();
}
if
(
hdr
.
payload_len
>
0
)
if
(
hdr
.
payload_len
>
0
)
return
await_payload
;
return
await_payload
;
}
}
CAF_LOG_DEBUG
(
CAF_ARG
(
hdr
));
if
(
!
valid
(
hdr
))
{
CAF_LOG_WARNING
(
"received invalid header:"
<<
CAF_ARG
(
hdr
.
operation
));
return
err
();
}
// needs forwarding?
// needs forwarding?
if
(
!
is_handshake
(
hdr
)
if
(
!
is_handshake
(
hdr
)
&&
!
is_heartbeat
(
hdr
)
&&
!
is_heartbeat
(
hdr
)
...
...
libcaf_io/src/basp_broker.cpp
View file @
a0f1066c
...
@@ -457,6 +457,14 @@ behavior basp_broker::make_behavior() {
...
@@ -457,6 +457,14 @@ behavior basp_broker::make_behavior() {
auto
next
=
state
.
instance
.
handle
(
context
(),
msg
,
ctx
.
hdr
,
auto
next
=
state
.
instance
.
handle
(
context
(),
msg
,
ctx
.
hdr
,
ctx
.
cstate
==
basp
::
await_payload
);
ctx
.
cstate
==
basp
::
await_payload
);
if
(
next
==
basp
::
close_connection
)
{
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_message
(
ok_atom
::
value
,
node_id
{
invalid_node_id
},
actor_addr
{
invalid_actor_addr
},
std
::
set
<
std
::
string
>
{}));
}
close
(
msg
.
handle
);
close
(
msg
.
handle
);
state
.
ctx
.
erase
(
msg
.
handle
);
state
.
ctx
.
erase
(
msg
.
handle
);
}
else
if
(
next
!=
ctx
.
cstate
)
{
}
else
if
(
next
!=
ctx
.
cstate
)
{
...
...
libcaf_io/src/middleman_actor.cpp
View file @
a0f1066c
...
@@ -118,7 +118,8 @@ public:
...
@@ -118,7 +118,8 @@ public:
if
(
i
==
pending_
.
end
())
if
(
i
==
pending_
.
end
())
return
;
return
;
monitor
(
addr
);
monitor
(
addr
);
cached_
.
emplace
(
key
,
std
::
make_tuple
(
nid
,
addr
,
sigs
));
if
(
nid
&&
addr
)
cached_
.
emplace
(
key
,
std
::
make_tuple
(
nid
,
addr
,
sigs
));
auto
res
=
make_message
(
ok_atom
::
value
,
std
::
move
(
nid
),
auto
res
=
make_message
(
ok_atom
::
value
,
std
::
move
(
nid
),
std
::
move
(
addr
),
std
::
move
(
sigs
));
std
::
move
(
addr
),
std
::
move
(
sigs
));
for
(
auto
&
x
:
i
->
second
)
for
(
auto
&
x
:
i
->
second
)
...
...
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