From 300a35a8e280c1dcd00c1f807f0ef6d44b1745fd Mon Sep 17 00:00:00 2001 From: subtly Date: Sat, 20 Jun 2015 03:23:20 -0400 Subject: [PATCH] prep, moving frame info to coder class. --- libp2p/RLPXFrameWriter.cpp | 12 ------------ libp2p/RLPXFrameWriter.h | 14 -------------- 2 files changed, 26 deletions(-) diff --git a/libp2p/RLPXFrameWriter.cpp b/libp2p/RLPXFrameWriter.cpp index a657afd70..c8c1e8ceb 100644 --- a/libp2p/RLPXFrameWriter.cpp +++ b/libp2p/RLPXFrameWriter.cpp @@ -25,18 +25,6 @@ using namespace std; using namespace dev; using namespace dev::p2p; -RLPXFrameInfo::RLPXFrameInfo(bytesConstRef _header) -{ - length = (_header[0] * 256 + _header[1]) * 256 + _header[2]; - padding = ((16 - (length % 16)) % 16); - RLP header(_header.cropped(3), RLP::ThrowOnFail | RLP::FailIfTooSmall); - auto itemCount = header.itemCount(); - protocolId = header[0].toInt(); - hasSequence = itemCount > 1; - sequenceId = hasSequence ? header[1].toInt() : 0; - totalLength = itemCount == 3 ? header[2].toInt() : 0; -} - void RLPXFrameWriter::enque(unsigned _packetType, RLPStream& _payload, PacketPriority _priority) { QueueState& qs = _priority ? m_q.first : m_q.second; diff --git a/libp2p/RLPXFrameWriter.h b/libp2p/RLPXFrameWriter.h index 384bf0503..3bbcb7a16 100644 --- a/libp2p/RLPXFrameWriter.h +++ b/libp2p/RLPXFrameWriter.h @@ -34,20 +34,6 @@ namespace p2p { struct RLPXFrameDecrytFailed: virtual dev::Exception {}; - -struct RLPXFrameInfo -{ - RLPXFrameInfo() = default; - /// Constructor. frame-size || protocol-type, [sequence-id[, total-packet-size]] - RLPXFrameInfo(bytesConstRef _frameHeader); - uint32_t length = 0; ///< Max: 2**24 - uint8_t padding = 0; - - uint16_t protocolId = 0; - bool hasSequence = false; - uint16_t sequenceId = 0; - uint32_t totalLength = 0; -}; /** * RLPFrameReader