This repository was archived by the owner on Oct 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ using namespace std;
1515const NodeIPEndpoint UnspecifiedNodeIPEndpoint = NodeIPEndpoint{{}, 0 , 0 };
1616const Node UnspecifiedNode = Node{{}, UnspecifiedNodeIPEndpoint};
1717
18- const char * packetTypeToString (PacketType _packetType)
18+ char const * packetTypeToString (PacketType _packetType)
1919{
2020 switch (_packetType)
2121 {
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ enum PacketType
8989 UserPacket = 0x10
9090};
9191
92- const char * packetTypeToString (PacketType _packetType);
92+ char const * packetTypeToString (PacketType _packetType);
9393
9494enum DisconnectReason
9595{
Original file line number Diff line number Diff line change @@ -367,9 +367,9 @@ void RLPXHandshake::transition(boost::system::error_code _ech)
367367 << m_socket->remoteEndpoint () << " . Validating contents..." ;
368368
369369 // / check frame size
370- bytes& header = m_handshakeInBuffer;
371- uint32_t frameSize = (uint32_t )(header[2 ]) | (uint32_t )(header[1 ]) << 8 |
372- (uint32_t )(header[0 ]) << 16 ;
370+ bytes const & header = m_handshakeInBuffer;
371+ uint32_t const frameSize = (uint32_t )(header[2 ]) | (uint32_t )(header[1 ]) << 8 |
372+ (uint32_t )(header[0 ]) << 16 ;
373373 constexpr size_t expectedFrameSizeBytes = 1024 ;
374374 if (frameSize > expectedFrameSizeBytes)
375375 {
@@ -472,14 +472,6 @@ void RLPXHandshake::transition(boost::system::error_code _ech)
472472 }
473473}
474474
475- const char * RLPXHandshake::connectionDirectionString () const
476- {
477- if (m_originated)
478- return " p2p.connect.egress: " ;
479- else
480- return " p2p.connect.ingress: " ;
481- }
482-
483475bool RLPXHandshake::remoteSocketConnected () const
484476{
485477 return m_socket && m_socket->isConnected () &&
Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ class RLPXHandshake: public std::enable_shared_from_this<RLPXHandshake>
9494 virtual void transition (boost::system::error_code _ech = boost::system::error_code());
9595
9696 // / Get a string indicating if the connection is incoming or outgoing
97- const char * connectionDirectionString () const ;
97+ inline char const * connectionDirectionString () const
98+ {
99+ return m_originated ? " egress" : " ingress" ;
100+ }
98101
99102 // / Determine if the remote socket is still connected
100103 bool remoteSocketConnected () const ;
@@ -132,7 +135,7 @@ class RLPXHandshake: public std::enable_shared_from_this<RLPXHandshake>
132135 // / Timer which enforces c_timeout. Reset for each stage of the handshake.
133136 ba::steady_timer m_idleTimer;
134137
135- Logger m_logger{createLogger (VerbosityDebug , " rlpx" )};
138+ Logger m_logger{createLogger (VerbosityTrace , " rlpx" )};
136139 Logger m_errorLogger{createLogger (VerbosityError, " rlpx" )};
137140};
138141
You can’t perform that action at this time.
0 commit comments