proxygen
|
#include <GzipHeaderCodec.h>
Public Member Functions | |
GzipHeaderCodec (int compressionLevel, const SPDYVersionSettings &versionSettings) | |
GzipHeaderCodec (int compressionLevel, SPDYVersion version=SPDYVersion::SPDY3_1) | |
~GzipHeaderCodec () override | |
std::unique_ptr< folly::IOBuf > | encode (std::vector< compress::Header > &headers) noexcept |
folly::Expected< HeaderDecodeResult, GzipDecodeError > | decode (folly::io::Cursor &cursor, uint32_t length) noexcept |
const HTTPHeaderSize & | getDecodedSize () |
Public Member Functions inherited from proxygen::HeaderCodec | |
HeaderCodec () | |
virtual | ~HeaderCodec () |
const HTTPHeaderSize & | getEncodedSize () |
void | setEncodeHeadroom (uint32_t headroom) |
virtual void | setMaxUncompressed (uint64_t maxUncompressed) |
uint64_t | getMaxUncompressed () const |
void | setStats (Stats *stats) |
Private Member Functions | |
folly::IOBuf & | getHeaderBuf () |
folly::Expected< size_t, GzipDecodeError > | parseNameValues (const folly::IOBuf &uncompressed, uint32_t uncompressedLength) noexcept |
Private Attributes | |
const SPDYVersionSettings & | versionSettings_ |
z_stream | deflater_ |
z_stream | inflater_ |
compress::HeaderPieceList | outHeaders_ |
HTTPHeaderSize | decodedSize_ |
Additional Inherited Members | |
Public Types inherited from proxygen::HeaderCodec | |
enum | Type : uint8_t { Type::GZIP = 0, Type::HPACK = 1, Type::QPACK = 2 } |
Static Public Attributes inherited from proxygen::HeaderCodec | |
static const uint32_t | kMaxUncompressed = 128 * 1024 |
Protected Attributes inherited from proxygen::HeaderCodec | |
HTTPHeaderSize | encodedSize_ |
uint32_t | encodeHeadroom_ {0} |
uint64_t | maxUncompressed_ {kMaxUncompressed} |
Stats * | stats_ {nullptr} |
Definition at line 34 of file GzipHeaderCodec.h.
proxygen::GzipHeaderCodec::GzipHeaderCodec | ( | int | compressionLevel, |
const SPDYVersionSettings & | versionSettings | ||
) |
Definition at line 156 of file GzipHeaderCodec.cpp.
References context, deflater_, and inflater_.
|
explicit |
Definition at line 166 of file GzipHeaderCodec.cpp.
|
override |
|
noexcept |
Definition at line 291 of file GzipHeaderCodec.cpp.
References proxygen::BAD_ENCODING, wangle::HTTPHeaderSize::compressed, decodedSize_, proxygen::SPDYVersionSettings::dict, proxygen::SPDYVersionSettings::dictSize, proxygen::ERROR, getHeaderBuf(), proxygen::HeaderCodec::GZIP, proxygen::HEADERS_TOO_LARGE, if(), proxygen::INFLATE_DICTIONARY, inflater_, folly::makeUnexpected(), proxygen::HeaderCodec::maxUncompressed_, min, cpp.ast::next(), outHeaders_, parseNameValues(), proxygen::HeaderCodec::Stats::recordDecode(), proxygen::HeaderCodec::stats_, uint32_t, uint8_t, wangle::HTTPHeaderSize::uncompressed, UNLIKELY, and versionSettings_.
Referenced by proxygen::SPDYCodec::decodeHeaders().
|
noexcept |
Definition at line 181 of file GzipHeaderCodec.cpp.
References folly::IOBuf::advance(), folly::IOBuf::append(), proxygen::SPDYVersionSettings::appendSizeFun, wangle::HTTPHeaderSize::compressed, deflater_, proxygen::empty_string, proxygen::HeaderCodec::encodedSize_, proxygen::HeaderCodec::encodeHeadroom_, getHeaderBuf(), proxygen::HeaderCodec::GZIP, proxygen::HTTP_HEADER_OTHER, folly::IOBuf::length(), proxygen::SPDYVersionSettings::nameValueSize, proxygen::HeaderCodec::Stats::recordEncode(), proxygen::HeaderCodec::stats_, folly::toLowerAscii(), uint8_t, wangle::HTTPHeaderSize::uncompressed, versionSettings_, and folly::IOBuf::writableData().
Referenced by proxygen::SPDYCodec::encodeHeaders().
|
inline |
same as above, but for decode
Definition at line 52 of file GzipHeaderCodec.h.
References folly::pushmi::__adl::noexcept(), and uint32_t.
Referenced by proxygen::SPDYCodec::onControlFrame().
|
private |
Definition at line 177 of file GzipHeaderCodec.cpp.
References proxygen::HeaderCodec::maxUncompressed_.
Referenced by decode(), and encode().
|
privatenoexcept |
Parse the decompressed name/value header block.
Definition at line 370 of file GzipHeaderCodec.cpp.
References proxygen::BAD_ENCODING, c, data, folly::Range< Iter >::data(), proxygen::EMPTY_HEADER_NAME, proxygen::EMPTY_HEADER_VALUE, proxygen::ERROR, folly::exceptionStr(), folly::gen::first, i, proxygen::INVALID_HEADER_VALUE, folly::makeUnexpected(), proxygen::SPDYVersionSettings::nameValueSize, cpp.ast::next(), outHeaders_, proxygen::SPDYVersionSettings::parseSizeFun, folly::io::detail::CursorBase< Derived, BufType >::peek(), proxygen::IOBufPrinter::printHexFolly(), folly::io::detail::CursorBase< Derived, BufType >::pull(), folly::Range< Iter >::reset(), folly::Range< Iter >::size(), folly::io::detail::CursorBase< Derived, BufType >::skip(), stop(), proxygen::compress::HeaderPiece::str, uint32_t, and versionSettings_.
Referenced by decode().
|
private |
Definition at line 70 of file GzipHeaderCodec.h.
Referenced by decode().
|
private |
Definition at line 67 of file GzipHeaderCodec.h.
Referenced by encode(), GzipHeaderCodec(), and ~GzipHeaderCodec().
|
private |
Definition at line 68 of file GzipHeaderCodec.h.
Referenced by decode(), GzipHeaderCodec(), and ~GzipHeaderCodec().
|
private |
Definition at line 69 of file GzipHeaderCodec.h.
Referenced by decode(), and parseNameValues().
|
private |
Definition at line 66 of file GzipHeaderCodec.h.
Referenced by decode(), encode(), and parseNameValues().