Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Log which peer gives unexpected length messages #5097

Merged
merged 2 commits into from
Aug 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ namespace eosio {
auto index = conn->pending_message_buffer.read_index();
conn->pending_message_buffer.peek(&message_length, sizeof(message_length), index);
if(message_length > def_send_buffer_size*2 || message_length == 0) {
elog("incoming message length unexpected (${i})", ("i", message_length));
elog("incoming message length unexpected (${i}), from ${p}", ("i", message_length)("p",boost::lexical_cast<std::string>(conn->socket->remote_endpoint())));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can throw an exception which will be caught below and report std::exception below. Pass boost::system::error_code ec; to remote_endpoint(ec); to avoid exception.

close(conn);
return;
}
Expand Down