15 using std::unique_ptr;
27 std::unique_ptr<folly::IOBuf> block,
30 Cursor cursor(block.get());
35 VLOG(5) <<
"largestReference=" << largestReference <<
" > baseIndex=" <<
38 VLOG(2) <<
"QPACK queue is full size=" <<
queue_.size()
47 dbuf.consumedBytes(), q.
move(),
48 totalBytes - dbuf.consumedBytes(), streamingCb);
59 LOG(
ERROR) <<
"Decode error decoding largest reference err_=" <<
err_;
62 VLOG(5) <<
"Decoded largestReference=" << largestReference;
65 LOG(
ERROR) <<
"Invalid prefix, no delta-base";
72 LOG(
ERROR) <<
"Decode error decoding delta base=" <<
err_;
76 if (delta > largestReference) {
77 LOG(
ERROR) <<
"Invalid delta=" << delta <<
" largestReference=" 86 VLOG(5) <<
"Decoded baseIndex_=" <<
baseIndex_;
87 return largestReference;
99 LOG(
ERROR) <<
"exceeded uncompressed size limit of " 142 std::unique_ptr<folly::IOBuf> buf) {
146 VLOG(6) <<
"Decoding control block";
149 while (!
hasError() && !dbuf.empty()) {
174 dbuf,
true,
true, HPACK::Q_INSERT_NAME_REF.prefixLength,
false,
187 CHECK(!emitted.empty());
200 bool allowPartial = (streamingCb ==
nullptr);
206 bool isStaticName = !aboveBase && (dbuf.
peek() & (1 << prefixLength));
212 LOG(
ERROR) <<
"Decode error decoding index err_=" <<
err_;
219 if (!
isValid(isStaticName, nameIndex, aboveBase)) {
220 LOG(
ERROR) <<
"received invalid index: " << nameIndex;
233 LOG(
ERROR) <<
"Error decoding header name err_=" <<
err_;
247 LOG(
ERROR) <<
"Error decoding header value name=" << partial->
header.
name 269 bool isStatic = !aboveBase && (dbuf.
peek() & (1 << prefixLength));
272 LOG(
ERROR) <<
"Decode error decoding index err_=" <<
err_;
279 if (index == 0 || !
isValid(isStatic, index, aboveBase)) {
280 LOG(
ERROR) <<
"received invalid index: " << index;
286 return emit(header, streamingCb, emitted);
295 baseIndex = baseIndex + index;
305 VLOG(6) <<
"encodeTableStateSync toAck=" << toAck;
318 VLOG(6) <<
"encodeHeaderAck id=" << streamId;
327 while (it !=
queue_.end()) {
328 if (it->second.streamID == streamId) {
344 std::unique_ptr<folly::IOBuf> block,
350 std::piecewise_construct,
351 std::forward_as_tuple(largestReference),
352 std::forward_as_tuple(streamID, baseIndex, length, consumed,
355 VLOG(5) <<
"queued block=" << largestReference <<
" len=" << length;
362 VLOG(5) <<
"decodeBlock len=" << pending.
length;
const Instruction Q_TABLE_STATE_SYNC
const Instruction Q_INSERT_NO_NAME_REF
const folly::IOBuf * front() const
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
size_t chainLength() const
std::unique_ptr< folly::IOBuf > encodeTableStateSync()
std::unique_ptr< folly::IOBuf > release()
HPACK::DecodeError decodeEncoderStream(std::unique_ptr< folly::IOBuf > buf)
uint32_t decodeLiteralHeaderQ(HPACKDecodeBuffer &dbuf, bool indexing, bool nameIndexed, uint8_t prefixLength, bool aboveBase, HPACK::StreamingCallback *streamingCb)
std::vector< HPACKHeader > headers_t
void enqueueHeaderBlock(uint64_t streamId, uint32_t largestReference, uint32_t baseIndex, uint32_t consumed, std::unique_ptr< folly::IOBuf > block, size_t length, HPACK::StreamingCallback *streamingCb)
folly::IOBufQueue ingress_
std::multimap< uint32_t, PendingBlock > queue_
const Instruction Q_DUPLICATE
const Instruction Q_INDEXED_POST
constexpr detail::Map< Move > move
void handleTableSizeUpdate(HPACKDecodeBuffer &dbuf, HeaderTable &table)
uint32_t decodeHeaderQ(HPACKDecodeBuffer &dbuf, HPACK::StreamingCallback *streamingCb)
const Instruction Q_LITERAL_NAME_REF_POST
void decodeEncoderStreamInstruction(HPACKDecodeBuffer &dbuf)
std::unique_ptr< folly::IOBuf > move()
const Instruction Q_LITERAL
uint32_t consumedBytes() const
uint32_t decodeIndexedHeaderQ(HPACKDecodeBuffer &dbuf, uint32_t prefixLength, bool aboveBase, HPACK::StreamingCallback *streamingCb, headers_t *emitted)
const HPACKHeader & getHeader(bool isStatic, uint32_t index, uint32_t base, bool aboveBase)
const Instruction Q_TABLE_SIZE_UPDATE
auto partial(F &&f, Args &&...args) -> detail::partial::Partial< typename std::decay< F >::type, std::tuple< typename std::decay< Args >::type... >>
void decodeStreaming(uint64_t streamId, std::unique_ptr< folly::IOBuf > block, uint32_t totalBytes, HPACK::StreamingCallback *streamingCb)
uint32_t emit(const HPACKHeader &header, HPACK::StreamingCallback *streamingCb, headers_t *emitted)
HPACK::DecodeError decodeLiteral(folly::fbstring &literal)
const Instruction Q_HEADER_ACK
const Instruction Q_INSERT_NAME_REF
uint32_t encodeInteger(uint64_t value, uint8_t instruction, uint8_t nbit)
bool decodeBlock(uint32_t largestReference, const PendingBlock &pending)
bool isValid(bool isStatic, uint32_t index, bool aboveBase)
const Instruction Q_DELTA_BASE
void completeDecode(HeaderCodec::Type type, HPACK::StreamingCallback *streamingCb, uint32_t compressedSize, uint32_t emittedSize)
uint64_t maxUncompressed_
const StaticHeaderTable & getStaticTable() const
std::unique_ptr< folly::IOBuf > block
void decodeStreamingImpl(uint32_t largestReference, uint32_t consumed, HPACKDecodeBuffer &dbuf, HPACK::StreamingCallback *streamingCb)
std::unique_ptr< folly::IOBuf > encodeHeaderAck(uint64_t streamId) const
void trimStart(size_t amount)
enum proxygen::QPACKDecoder::Partial::@105 NAME
HPACK::DecodeError decodeInteger(uint8_t nbit, uint64_t &integer)
uint32_t handleBaseIndex(HPACKDecodeBuffer &dbuf)
const uint8_t Q_DELTA_BASE_NEG
HPACK::StreamingCallback * cb
const Instruction Q_INDEXED
std::unique_ptr< folly::IOBuf > encodeCancelStream(uint64_t streamId)
const Instruction Q_LITERAL_NAME_REF
const Instruction Q_CANCEL_STREAM