proxygen
HPACKEncoderBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
15 
16 namespace proxygen {
17 
22  public:
23 
24  explicit HPACKEncoderBase(bool huffman)
25  : streamBuffer_(kBufferGrowth, huffman) {
27  }
28 
34  static const uint32_t kBufferGrowth = 4000;
35 
37  if (size != table.capacity()) {
38  CHECK(table.setCapacity(size));
39  pendingContextUpdate_ = true;
40  }
41  }
42 
44  indexingStrat_ = indexingStrat;
45  }
47  return indexingStrat_;
48  }
49 
50  protected:
51 
53  uint32_t tableCapacity);
54 
57  bool pendingContextUpdate_{false};
58 };
59 
60 
61 }
uint32_t capacity() const
Definition: HeaderTable.h:86
void setHeaderIndexingStrategy(const HeaderIndexingStrategy *indexingStrat)
HPACKEncodeBuffer streamBuffer_
static const uint32_t kBufferGrowth
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
void handlePendingContextUpdate(HPACKEncodeBuffer &buf, uint32_t tableCapacity)
static const HeaderIndexingStrategy * getDefaultInstance()
void setHeaderTableSize(HeaderTable &table, uint32_t size)
const HeaderIndexingStrategy * indexingStrat_
const HeaderIndexingStrategy * getHeaderIndexingStrategy() const
virtual bool setCapacity(uint32_t capacity)