16 namespace proxygen {
namespace compress {
38 std::unique_ptr<folly::IOBuf> hAck,
39 std::unique_ptr<folly::IOBuf> cAck) :
52 VLOG(4) <<
"Sending ack for seqn=" <<
seqn;
58 void recvAck(std::unique_ptr<Ack> ack)
override {
60 auto qpackAck =
dynamic_cast<QPACKAck*
>(ack.get());
61 CHECK_NOTNULL(qpackAck);
62 VLOG(4) <<
"Received ack for seqn=" << qpackAck->seqn;
63 CHECK(qpackAck->headerAck);
64 if (qpackAck->controlAck) {
65 qpackAck->headerAck->prependChain(
std::move(qpackAck->controlAck));
70 auto it =
acks_.begin();
78 }
while (!
acks_.empty());
81 std::pair<FrameFlags, std::unique_ptr<folly::IOBuf>>
encode(
83 std::vector<compress::Header> allHeaders,
93 len = result.control->computeChainDataLength();
103 len = result.stream->computeChainDataLength();
116 std::unique_ptr<folly::IOBuf> encodedReq,
124 auto controlIndex = cursor.readBE<
uint16_t>();
126 std::unique_ptr<folly::IOBuf> control;
127 cursor.clone(control, len);
130 VLOG(5) <<
"decode controlIndex=" << controlIndex;
136 VLOG(5) <<
"decode controlIndex=" <<
controlQueue_.begin()->first;
151 <<
" header seqn=" <<
seqn 156 queue.trimStart(toTrim);
173 std::map<uint16_t, std::unique_ptr<folly::IOBuf>>
acks_;
std::unique_ptr< Ack > getAck(uint16_t seqn) override
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
std::map< uint16_t, std::unique_ptr< folly::IOBuf > > acks_
std::unique_ptr< folly::IOBuf > controlAck
QPACKAck(uint16_t n, uint16_t an, std::unique_ptr< folly::IOBuf > hAck, std::unique_ptr< folly::IOBuf > cAck)
uint32_t getHolBlockCount() const override
constexpr detail::Map< Move > move
std::map< uint16_t, std::unique_ptr< folly::IOBuf > > controlQueue_
void decode(FrameFlags flags, std::unique_ptr< folly::IOBuf > encodedReq, SimStats &stats, SimStreamingCallback &callback) override
std::unique_ptr< folly::IOBuf > move()
std::pair< FrameFlags, std::unique_ptr< folly::IOBuf > > encode(bool, std::vector< compress::Header > allHeaders, SimStats &stats) override
void setMaxVulnerable(uint32_t maxVulnerable)
uint16_t encodeControlIndex_
QPACKEncoder::EncodeResult encode(std::vector< compress::Header > &headers, uint64_t id) noexcept
void recvAck(std::unique_ptr< Ack > ack) override
void insert(std::unique_ptr< folly::IOBuf > buf)
std::unique_ptr< folly::IOBuf > headerAck
HPACK::DecodeError decodeEncoderStream(std::unique_ptr< folly::IOBuf > buf)
void setDecoderHeaderTableMaxSize(uint32_t size)
std::unique_ptr< folly::IOBuf > encodeHeaderAck(uint64_t streamId)
static const NoPathIndexingStrategy * getInstance()
HPACK::DecodeError decodeDecoderStream(std::unique_ptr< folly::IOBuf > buf)
void setMaxBlocking(uint32_t maxBlocking)
void setHeaderIndexingStrategy(const HeaderIndexingStrategy *indexingStrat)
uint64_t getQueuedBytes() const
std::unique_ptr< folly::IOBuf > encodeTableStateSync()
void setEncoderHeaderTableSize(uint32_t size)
uint64_t maxQueueBufferBytes
QPACKScheme(CompressionSimulator *sim, uint32_t tableSize, uint32_t maxBlocking)
uint16_t decodeControlIndex_
uint64_t getHolBlockCount() const
void decodeStreaming(uint64_t streamId, std::unique_ptr< folly::IOBuf > block, uint32_t length, HPACK::StreamingCallback *streamingCb) noexcept