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
a147db9a
Commit
a147db9a
authored
Jul 19, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce verbosity of network components
parent
167d9f3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
24 deletions
+21
-24
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+18
-21
libcaf_io/src/broker.cpp
libcaf_io/src/broker.cpp
+2
-2
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+1
-1
No files found.
libcaf_io/src/basp_broker.cpp
View file @
a147db9a
...
@@ -107,8 +107,8 @@ behavior basp_broker::make_behavior() {
...
@@ -107,8 +107,8 @@ behavior basp_broker::make_behavior() {
erase_proxy
(
nid
,
aid
);
erase_proxy
(
nid
,
aid
);
},
},
others
()
>>
[
=
]
{
others
()
>>
[
=
]
{
CAF_LOG_
ERROR
(
"received unexpected message: "
CAF_LOG_
INFO
(
"received unexpected message: "
<<
to_string
(
last_dequeued
()));
<<
to_string
(
last_dequeued
()));
}
}
};
};
}
}
...
@@ -122,7 +122,7 @@ void basp_broker::new_data(connection_context& ctx, buffer_type& buf) {
...
@@ -122,7 +122,7 @@ void basp_broker::new_data(connection_context& ctx, buffer_type& buf) {
binary_deserializer
bd
{
buf
.
data
(),
buf
.
size
(),
&
m_namespace
};
binary_deserializer
bd
{
buf
.
data
(),
buf
.
size
(),
&
m_namespace
};
read
(
bd
,
ctx
.
hdr
);
read
(
bd
,
ctx
.
hdr
);
if
(
!
basp
::
valid
(
ctx
.
hdr
))
{
if
(
!
basp
::
valid
(
ctx
.
hdr
))
{
CAF_LOG_
ERROR
(
"invalid broker message received"
);
CAF_LOG_
INFO
(
"invalid broker message received"
);
close
(
ctx
.
hdl
);
close
(
ctx
.
hdl
);
return
;
return
;
}
}
...
@@ -182,9 +182,8 @@ void basp_broker::dispatch(const actor_addr& from,
...
@@ -182,9 +182,8 @@ void basp_broker::dispatch(const actor_addr& from,
auto
dest
=
to
.
node
();
auto
dest
=
to
.
node
();
auto
hdl
=
get_route
(
dest
);
auto
hdl
=
get_route
(
dest
);
if
(
hdl
.
invalid
())
{
if
(
hdl
.
invalid
())
{
CAF_LOG_WARNING
(
"unable to dispatch message: no route to "
CAF_LOG_INFO
(
"unable to dispatch message: no route to "
<<
to_string
(
dest
)
<<
", message: "
<<
to_string
(
dest
)
<<
", message: "
<<
to_string
(
msg
));
<<
to_string
(
msg
));
return
;
return
;
}
}
auto
&
buf
=
wr_buf
(
hdl
);
auto
&
buf
=
wr_buf
(
hdl
);
...
@@ -253,8 +252,8 @@ basp_broker::handle_basp_header(connection_context& ctx,
...
@@ -253,8 +252,8 @@ basp_broker::handle_basp_header(connection_context& ctx,
auto
hdl
=
get_route
(
hdr
.
dest_node
);
auto
hdl
=
get_route
(
hdr
.
dest_node
);
if
(
hdl
.
invalid
())
{
if
(
hdl
.
invalid
())
{
// TODO: signalize that we don't have route to given node
// TODO: signalize that we don't have route to given node
CAF_LOG_
ERROR
(
"message dropped: no route to node "
CAF_LOG_
INFO
(
"message dropped: no route to node "
<<
to_string
(
hdr
.
dest_node
));
<<
to_string
(
hdr
.
dest_node
));
return
close_connection
;
return
close_connection
;
}
}
auto
&
buf
=
wr_buf
(
hdl
);
auto
&
buf
=
wr_buf
(
hdl
);
...
@@ -315,7 +314,7 @@ basp_broker::handle_basp_header(connection_context& ctx,
...
@@ -315,7 +314,7 @@ basp_broker::handle_basp_header(connection_context& ctx,
case
basp
:
:
client_handshake
:
{
case
basp
:
:
client_handshake
:
{
CAF_REQUIRE
(
payload
==
nullptr
);
CAF_REQUIRE
(
payload
==
nullptr
);
if
(
ctx
.
remote_id
!=
invalid_node_id
)
{
if
(
ctx
.
remote_id
!=
invalid_node_id
)
{
CAF_LOG_
WARNING
(
"received unexpected client handshake"
);
CAF_LOG_
INFO
(
"received unexpected client handshake"
);
return
close_connection
;
return
close_connection
;
}
}
ctx
.
remote_id
=
hdr
.
source_node
;
ctx
.
remote_id
=
hdr
.
source_node
;
...
@@ -324,7 +323,7 @@ basp_broker::handle_basp_header(connection_context& ctx,
...
@@ -324,7 +323,7 @@ basp_broker::handle_basp_header(connection_context& ctx,
return
close_connection
;
return
close_connection
;
}
}
else
if
(
!
try_set_default_route
(
ctx
.
remote_id
,
ctx
.
hdl
))
{
else
if
(
!
try_set_default_route
(
ctx
.
remote_id
,
ctx
.
hdl
))
{
CAF_LOG_
WARNING
(
"multiple incoming connections "
CAF_LOG_
INFO
(
"multiple incoming connections "
"from the same node"
);
"from the same node"
);
return
close_connection
;
return
close_connection
;
}
}
...
@@ -333,12 +332,12 @@ basp_broker::handle_basp_header(connection_context& ctx,
...
@@ -333,12 +332,12 @@ basp_broker::handle_basp_header(connection_context& ctx,
case
basp
:
:
server_handshake
:
{
case
basp
:
:
server_handshake
:
{
CAF_REQUIRE
(
payload
!=
nullptr
);
CAF_REQUIRE
(
payload
!=
nullptr
);
if
(
ctx
.
handshake_data
==
nullptr
)
{
if
(
ctx
.
handshake_data
==
nullptr
)
{
CAF_LOG_
WARNING
(
"received unexpected server handshake"
);
CAF_LOG_
INFO
(
"received unexpected server handshake"
);
return
close_connection
;
return
close_connection
;
}
}
if
(
hdr
.
operation_data
!=
basp
::
version
)
{
if
(
hdr
.
operation_data
!=
basp
::
version
)
{
CAF_LOG_
ERROR
(
"tried to connect to a node with "
CAF_LOG_
INFO
(
"tried to connect to a node with "
"different BASP version"
);
"different BASP version"
);
return
close_connection
;
return
close_connection
;
}
}
ctx
.
remote_id
=
hdr
.
source_node
;
ctx
.
remote_id
=
hdr
.
source_node
;
...
@@ -404,10 +403,9 @@ basp_broker::handle_basp_header(connection_context& ctx,
...
@@ -404,10 +403,9 @@ basp_broker::handle_basp_header(connection_context& ctx,
<<
to_string
(
nid
)
<<
to_string
(
nid
)
<<
" (re-use old one)"
);
<<
" (re-use old one)"
);
auto
proxy
=
m_namespace
.
get
(
nid
,
remote_aid
);
auto
proxy
=
m_namespace
.
get
(
nid
,
remote_aid
);
CAF_LOG_WARNING_IF
(
!
proxy
,
CAF_LOG_INFO_IF
(
!
proxy
,
"no proxy for published actor "
"no proxy for published actor found "
"found although an open "
"although an open connection exists"
);
"connection exists"
);
// discard this peer; there's already an open connection
// discard this peer; there's already an open connection
ctx
.
handshake_data
->
result
->
set_value
(
std
::
move
(
proxy
));
ctx
.
handshake_data
->
result
->
set_value
(
std
::
move
(
proxy
));
ctx
.
handshake_data
=
nullptr
;
ctx
.
handshake_data
=
nullptr
;
...
@@ -439,8 +437,7 @@ void basp_broker::send_kill_proxy_instance(const id_type& nid,
...
@@ -439,8 +437,7 @@ void basp_broker::send_kill_proxy_instance(const id_type& nid,
auto
hdl
=
get_route
(
nid
);
auto
hdl
=
get_route
(
nid
);
CAF_LOG_DEBUG
(
CAF_MARG
(
hdl
,
id
));
CAF_LOG_DEBUG
(
CAF_MARG
(
hdl
,
id
));
if
(
hdl
.
invalid
())
{
if
(
hdl
.
invalid
())
{
CAF_LOG_WARNING
(
"message dropped, no route to node: "
CAF_LOG_INFO
(
"message dropped, no route to node: "
<<
to_string
(
nid
));
<<
to_string
(
nid
));
return
;
return
;
}
}
auto
&
buf
=
wr_buf
(
hdl
);
auto
&
buf
=
wr_buf
(
hdl
);
...
@@ -481,8 +478,8 @@ actor_proxy_ptr basp_broker::make_proxy(const id_type& nid, actor_id aid) {
...
@@ -481,8 +478,8 @@ actor_proxy_ptr basp_broker::make_proxy(const id_type& nid, actor_id aid) {
if
(
hdl
.
invalid
())
{
if
(
hdl
.
invalid
())
{
// this happens if and only if we don't have a path to @p nid
// this happens if and only if we don't have a path to @p nid
// and m_current_context->hdl has been blacklisted
// and m_current_context->hdl has been blacklisted
CAF_LOG_
WARNING
(
"cannot create a proxy instance for an actor "
CAF_LOG_
INFO
(
"cannot create a proxy instance for an actor "
"running on a node we don't have a route to"
);
"running on a node we don't have a route to"
);
return
nullptr
;
return
nullptr
;
}
}
// create proxy and add functor that will be called if we
// create proxy and add functor that will be called if we
...
...
libcaf_io/src/broker.cpp
View file @
a147db9a
...
@@ -215,8 +215,8 @@ void broker::invoke_message(const actor_addr& sender,
...
@@ -215,8 +215,8 @@ void broker::invoke_message(const actor_addr& sender,
}
}
}
}
catch
(
std
::
exception
&
e
)
{
catch
(
std
::
exception
&
e
)
{
CAF_LOG_
ERROR
(
"broker killed due to an unhandled exception: "
CAF_LOG_
INFO
(
"broker killed due to an unhandled exception: "
<<
to_verbose_string
(
e
));
<<
to_verbose_string
(
e
));
// keep compiler happy in non-debug mode
// keep compiler happy in non-debug mode
static_cast
<
void
>
(
e
);
static_cast
<
void
>
(
e
);
quit
(
exit_reason
::
unhandled_exception
);
quit
(
exit_reason
::
unhandled_exception
);
...
...
libcaf_io/src/middleman.cpp
View file @
a147db9a
...
@@ -84,7 +84,7 @@ inline void serialize_impl(const new_data_msg& msg, serializer* sink) {
...
@@ -84,7 +84,7 @@ inline void serialize_impl(const new_data_msg& msg, serializer* sink) {
oss
<<
"attempted to send more than "
oss
<<
"attempted to send more than "
<<
std
::
numeric_limits
<
uint32_t
>::
max
()
<<
" bytes"
;
<<
std
::
numeric_limits
<
uint32_t
>::
max
()
<<
" bytes"
;
auto
errstr
=
oss
.
str
();
auto
errstr
=
oss
.
str
();
CAF_LOGF_
ERROR
(
errstr
);
CAF_LOGF_
INFO
(
errstr
);
throw
std
::
ios_base
::
failure
(
std
::
move
(
errstr
));
throw
std
::
ios_base
::
failure
(
std
::
move
(
errstr
));
}
}
sink
->
write_value
(
buf_size
);
sink
->
write_value
(
buf_size
);
...
...
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