proxygen
proxygen::HPACKEncoderBase Class Reference

#include <HPACKEncoderBase.h>

Inheritance diagram for proxygen::HPACKEncoderBase:
proxygen::HPACKEncoder proxygen::QPACKEncoder

Public Member Functions

 HPACKEncoderBase (bool huffman)
 
void setHeaderTableSize (HeaderTable &table, uint32_t size)
 
void setHeaderIndexingStrategy (const HeaderIndexingStrategy *indexingStrat)
 
const HeaderIndexingStrategygetHeaderIndexingStrategy () const
 

Static Public Attributes

static const uint32_t kBufferGrowth = 4000
 

Protected Member Functions

void handlePendingContextUpdate (HPACKEncodeBuffer &buf, uint32_t tableCapacity)
 

Protected Attributes

const HeaderIndexingStrategyindexingStrat_
 
HPACKEncodeBuffer streamBuffer_
 
bool pendingContextUpdate_ {false}
 

Detailed Description

Common encoder functionality between HPACK and QPACK

Definition at line 21 of file HPACKEncoderBase.h.

Constructor & Destructor Documentation

proxygen::HPACKEncoderBase::HPACKEncoderBase ( bool  huffman)
inlineexplicit

Definition at line 24 of file HPACKEncoderBase.h.

References proxygen::HeaderIndexingStrategy::getDefaultInstance(), and indexingStrat_.

25  : streamBuffer_(kBufferGrowth, huffman) {
27  }
HPACKEncodeBuffer streamBuffer_
static const uint32_t kBufferGrowth
static const HeaderIndexingStrategy * getDefaultInstance()
const HeaderIndexingStrategy * indexingStrat_

Member Function Documentation

const HeaderIndexingStrategy* proxygen::HPACKEncoderBase::getHeaderIndexingStrategy ( ) const
inline

Definition at line 46 of file HPACKEncoderBase.h.

References handlePendingContextUpdate(), indexingStrat_, and uint32_t.

46  {
47  return indexingStrat_;
48  }
const HeaderIndexingStrategy * indexingStrat_
void proxygen::HPACKEncoderBase::handlePendingContextUpdate ( HPACKEncodeBuffer buf,
uint32_t  tableCapacity 
)
protected

Definition at line 14 of file HPACKEncoderBase.cpp.

References proxygen::HPACKEncodeBuffer::encodeInteger(), pendingContextUpdate_, proxygen::HPACK::Q_TABLE_SIZE_UPDATE, and proxygen::HPACK::TABLE_SIZE_UPDATE.

Referenced by proxygen::HPACKEncoder::encode(), proxygen::QPACKEncoder::encode(), and getHeaderIndexingStrategy().

15  {
17  "Code assumes these are equal";
19  VLOG(5) << "Encoding table size update size=" << tableCapacity;
20  buf.encodeInteger(tableCapacity, HPACK::TABLE_SIZE_UPDATE);
21  pendingContextUpdate_ = false;
22  }
23 }
const Instruction TABLE_SIZE_UPDATE
const Instruction Q_TABLE_SIZE_UPDATE
void proxygen::HPACKEncoderBase::setHeaderIndexingStrategy ( const HeaderIndexingStrategy indexingStrat)
inline

Definition at line 43 of file HPACKEncoderBase.h.

References indexingStrat_.

Referenced by proxygen::QPACKEncoder::QPACKEncoder().

43  {
44  indexingStrat_ = indexingStrat;
45  }
const HeaderIndexingStrategy * indexingStrat_
void proxygen::HPACKEncoderBase::setHeaderTableSize ( HeaderTable table,
uint32_t  size 
)
inline

Definition at line 36 of file HPACKEncoderBase.h.

References proxygen::HeaderTable::capacity(), pendingContextUpdate_, and proxygen::HeaderTable::setCapacity().

Referenced by proxygen::HPACKEncoder::setHeaderTableSize(), and proxygen::QPACKEncoder::setHeaderTableSize().

36  {
37  if (size != table.capacity()) {
38  CHECK(table.setCapacity(size));
39  pendingContextUpdate_ = true;
40  }
41  }
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45

Member Data Documentation

const uint32_t proxygen::HPACKEncoderBase::kBufferGrowth = 4000
static

Size of a new IOBuf which is added to the chain

jemalloc will round up to 4k - overhead

Definition at line 34 of file HPACKEncoderBase.h.

bool proxygen::HPACKEncoderBase::pendingContextUpdate_ {false}
protected

Definition at line 57 of file HPACKEncoderBase.h.

Referenced by handlePendingContextUpdate(), and setHeaderTableSize().


The documentation for this class was generated from the following files: