proxygen
|
#include <HPACKDecodeBuffer.h>
Public Member Functions | |
HPACKDecodeBuffer (folly::io::Cursor &cursorVal, uint32_t totalBytes, uint32_t maxLiteralSize) | |
~HPACKDecodeBuffer () | |
void | reset (folly::io::Cursor &cursorVal) |
void | reset (folly::io::Cursor &cursorVal, uint32_t totalBytes) |
uint32_t | consumedBytes () const |
const folly::io::Cursor & | cursor () const |
bool | empty () |
uint8_t | next () |
uint8_t | peek () |
HPACK::DecodeError | decodeInteger (uint8_t nbit, uint64_t &integer) |
HPACK::DecodeError | decodeInteger (uint64_t &integer) |
HPACK::DecodeError | decodeLiteral (folly::fbstring &literal) |
HPACK::DecodeError | decodeLiteral (uint8_t nbit, folly::fbstring &literal) |
Private Attributes | |
folly::io::Cursor & | cursor_ |
uint32_t | totalBytes_ |
uint32_t | remainingBytes_ |
uint32_t | maxLiteralSize_ {std::numeric_limits<uint32_t>::max()} |
Definition at line 21 of file HPACKDecodeBuffer.h.
|
inlineexplicit |
Definition at line 24 of file HPACKDecodeBuffer.h.
|
inline |
Definition at line 32 of file HPACKDecodeBuffer.h.
|
inline |
Definition at line 45 of file HPACKDecodeBuffer.h.
References remainingBytes_, and totalBytes_.
Referenced by proxygen::QPACKDecoder::decodeEncoderStreamInstruction(), proxygen::QPACKDecoder::decodeLiteralHeaderQ(), proxygen::HPACKDecoder::decodeStreaming(), and proxygen::QPACKDecoder::decodeStreamingImpl().
|
inline |
Definition at line 49 of file HPACKDecodeBuffer.h.
References cursor_, decodeInteger(), decodeLiteral(), empty(), next(), peek(), uint64_t, and uint8_t.
DecodeError proxygen::HPACKDecodeBuffer::decodeInteger | ( | uint8_t | nbit, |
uint64_t & | integer | ||
) |
decode an integer from the current position, given a nbit prefix. Ignores 8 - nbit bits in the first byte of the buffer.
Definition at line 101 of file HPACKDecodeBuffer.cpp.
References add, proxygen::ERROR, f, max, proxygen::HPACK::NBIT_MASKS, next(), proxygen::NONE, remainingBytes_, uint32_t, uint64_t, and uint8_t.
Referenced by cursor(), proxygen::QPACKEncoder::decodeHeaderAck(), proxygen::HPACKDecoder::decodeIndexedHeader(), proxygen::QPACKDecoder::decodeIndexedHeaderQ(), decodeInteger(), decodeLiteral(), proxygen::HPACKDecoder::decodeLiteralHeader(), proxygen::QPACKDecoder::decodeLiteralHeaderQ(), proxygen::QPACKDecoder::handleBaseIndex(), and proxygen::HPACKDecoderBase::handleTableSizeUpdate().
DecodeError proxygen::HPACKDecodeBuffer::decodeInteger | ( | uint64_t & | integer | ) |
As above but with no prefix
Definition at line 97 of file HPACKDecodeBuffer.cpp.
References decodeInteger().
DecodeError proxygen::HPACKDecodeBuffer::decodeLiteral | ( | folly::fbstring & | literal | ) |
decode a literal starting from the current position
Definition at line 44 of file HPACKDecodeBuffer.cpp.
Referenced by cursor(), proxygen::HPACKDecoder::decodeLiteralHeader(), and proxygen::QPACKDecoder::decodeLiteralHeaderQ().
DecodeError proxygen::HPACKDecodeBuffer::decodeLiteral | ( | uint8_t | nbit, |
folly::fbstring & | literal | ||
) |
Definition at line 48 of file HPACKDecodeBuffer.cpp.
References folly::basic_fbstring< E, T, A, Storage >::append(), folly::basic_fbstring< E, T, A, Storage >::clear(), cursor_, data, folly::io::detail::CursorBase< Derived, BufType >::data(), folly::IOBuf::data(), decodeInteger(), proxygen::ERROR, proxygen::huffman::huffTree(), folly::io::detail::CursorBase< Derived, BufType >::length(), maxLiteralSize_, proxygen::NONE, peek(), folly::io::detail::CursorBase< Derived, BufType >::pull(), remainingBytes_, folly::size(), folly::io::detail::CursorBase< Derived, BufType >::skip(), uint64_t, uint8_t, and folly::IOBuf::writableData().
bool proxygen::HPACKDecodeBuffer::empty | ( | ) |
Definition at line 22 of file HPACKDecodeBuffer.cpp.
References remainingBytes_.
Referenced by cursor(), proxygen::HPACKDecoder::decodeStreaming(), proxygen::QPACKDecoder::decodeStreamingImpl(), and proxygen::QPACKDecoder::handleBaseIndex().
uint8_t proxygen::HPACKDecodeBuffer::next | ( | ) |
extracts one byte from the buffer and advances the cursor
Definition at line 26 of file HPACKDecodeBuffer.cpp.
References cursor_, peek(), remainingBytes_, folly::io::detail::CursorBase< Derived, BufType >::skip(), and uint8_t.
Referenced by cursor(), decodeInteger(), and proxygen::HPACKDecoder::decodeLiteralHeader().
uint8_t proxygen::HPACKDecodeBuffer::peek | ( | ) |
just peeks at the next available byte without moving the cursor
Definition at line 36 of file HPACKDecodeBuffer.cpp.
References cursor_, folly::io::detail::CursorBase< Derived, BufType >::data(), folly::io::detail::CursorBase< Derived, BufType >::length(), folly::io::detail::CursorBase< Derived, BufType >::peek(), and remainingBytes_.
Referenced by cursor(), proxygen::QPACKDecoder::decodeEncoderStreamInstruction(), proxygen::HPACKDecoder::decodeHeader(), proxygen::QPACKDecoder::decodeHeaderQ(), proxygen::QPACKDecoder::decodeIndexedHeaderQ(), decodeLiteral(), proxygen::HPACKDecoder::decodeLiteralHeader(), proxygen::QPACKDecoder::decodeLiteralHeaderQ(), proxygen::QPACKDecoder::handleBaseIndex(), and next().
|
inline |
Definition at line 34 of file HPACKDecodeBuffer.h.
References folly::io::detail::CursorBase< Derived, BufType >::totalLength().
|
inline |
Definition at line 38 of file HPACKDecodeBuffer.h.
References cursor_, remainingBytes_, and totalBytes_.
|
private |
Definition at line 88 of file HPACKDecodeBuffer.h.
Referenced by cursor(), decodeLiteral(), next(), peek(), and reset().
|
private |
Definition at line 91 of file HPACKDecodeBuffer.h.
Referenced by decodeLiteral().
|
private |
Definition at line 90 of file HPACKDecodeBuffer.h.
Referenced by consumedBytes(), decodeInteger(), decodeLiteral(), empty(), next(), peek(), and reset().
|
private |
Definition at line 89 of file HPACKDecodeBuffer.h.
Referenced by consumedBytes(), and reset().