17 using std::unique_ptr;
52 LOG(
ERROR) <<
"remainingBytes_ == 0";
53 return DecodeError::BUFFER_UNDERFLOW;
57 bool huffman = byte & huffmanCheck;
62 LOG(
ERROR) <<
"Could not decode literal size";
66 LOG(
ERROR) <<
"size > remainingBytes_ decoding literal size=" 68 return DecodeError::BUFFER_UNDERFLOW;
71 LOG(
ERROR) <<
"Literal too large, size=" <<
size;
72 return DecodeError::LITERAL_TOO_LARGE;
75 unique_ptr<IOBuf> tmpbuf;
82 tmpbuf = IOBuf::create(size);
85 data = tmpbuf->
data();
89 huffmanTree.decode(data, size, literal);
91 literal.
append((
const char *)data, size);
103 LOG(
ERROR) <<
"remainingBytes_ == 0";
104 return DecodeError::BUFFER_UNDERFLOW;
119 LOG(
ERROR) <<
"remainingBytes_ == 0";
120 return DecodeError::BUFFER_UNDERFLOW;
125 LOG(
ERROR) <<
"overflow fexp=" << fexp;
126 return DecodeError::INTEGER_OVERFLOW;
131 LOG(
ERROR) <<
"overflow integer=" << integer <<
" add=" <<
add;
132 return DecodeError::INTEGER_OVERFLOW;
137 }
while (byte & 128);
142 return os << static_cast<uint32_t>(err);
const uint8_t * data() const
folly::io::Cursor & cursor_
std::ostream & operator<<(std::ostream &os, const HeaderTable &table)
const uint8_t * data() const
void pull(void *buf, size_t len)
std::pair< const uint8_t *, size_t > peek()
constexpr auto size(C const &c) -> decltype(c.size())
HPACK::DecodeError decodeLiteral(folly::fbstring &literal)
HPACK::DecodeError decodeInteger(uint8_t nbit, uint64_t &integer)
const HuffTree & huffTree()
basic_fbstring & append(const basic_fbstring &str)
const uint8_t NBIT_MASKS[9]
static constexpr uint64_t data[1]