proxygen
|
#include <ZlibServerFilter.h>
Public Member Functions | |
ZlibServerFilter (RequestHandler *downstream, int32_t compressionLevel, uint32_t minimumCompressionSize, const std::shared_ptr< std::set< std::string >> compressibleContentTypes) | |
void | sendHeaders (HTTPMessage &msg) noexceptoverride |
void | sendChunkHeader (size_t len) noexceptoverride |
void | sendBody (std::unique_ptr< folly::IOBuf > body) noexceptoverride |
void | sendEOM () noexceptoverride |
Public Member Functions inherited from proxygen::Filter | |
Filter (RequestHandler *upstream) | |
void | setResponseHandler (ResponseHandler *handler) noexceptoverride |
void | onRequest (std::unique_ptr< HTTPMessage > headers) noexceptoverride |
void | onBody (std::unique_ptr< folly::IOBuf > body) noexceptoverride |
void | onUpgrade (UpgradeProtocol protocol) noexceptoverride |
void | onEOM () noexceptoverride |
void | requestComplete () noexceptoverride |
void | onError (ProxygenError err) noexceptoverride |
void | onEgressPaused () noexceptoverride |
void | onEgressResumed () noexceptoverride |
bool | canHandleExpect () noexceptoverride |
ExMessageHandler * | getExHandler () noexceptoverride |
void | sendHeaders (HTTPMessage &msg) noexceptoverride |
void | sendChunkHeader (size_t len) noexceptoverride |
void | sendBody (std::unique_ptr< folly::IOBuf > body) noexceptoverride |
void | sendChunkTerminator () noexceptoverride |
void | sendEOM () noexceptoverride |
void | sendAbort () noexceptoverride |
void | refreshTimeout () noexceptoverride |
void | pauseIngress () noexceptoverride |
void | resumeIngress () noexceptoverride |
ResponseHandler * | newPushedResponse (PushHandler *handler) noexceptoverride |
const wangle::TransportInfo & | getSetupTransportInfo () const noexceptoverride |
void | getCurrentTransportInfo (wangle::TransportInfo *tinfo) const override |
Public Member Functions inherited from proxygen::RequestHandler | |
virtual ResponseHandler * | getDownstream () noexcept |
virtual | ~RequestHandler () |
Public Member Functions inherited from proxygen::ResponseHandler | |
ResponseHandler (RequestHandler *upstream) | |
virtual | ~ResponseHandler () |
virtual ResponseHandler * | newExMessage (ExMessageHandler *, bool=false) noexcept |
HTTPTransaction * | getTransaction () const noexcept |
Protected Member Functions | |
void | fail () |
bool | isMinimumCompressibleSize (const HTTPMessage &msg) const noexcept |
bool | isCompressibleContentType (const HTTPMessage &msg) const noexcept |
Protected Attributes | |
std::unique_ptr< HTTPMessage > | responseMessage_ |
std::unique_ptr< ZlibStreamCompressor > | compressor_ {nullptr} |
int32_t | compressionLevel_ {4} |
uint32_t | minimumCompressionSize_ {1000} |
const std::shared_ptr< std::set< std::string > > | compressibleContentTypes_ |
bool | header_ {false} |
bool | chunked_ {false} |
bool | compress_ {false} |
Protected Attributes inherited from proxygen::RequestHandler | |
ResponseHandler * | downstream_ {nullptr} |
Protected Attributes inherited from proxygen::ResponseHandler | |
RequestHandler * | upstream_ {nullptr} |
HTTPTransaction * | txn_ {nullptr} |
A Server filter to perform GZip compression. If there are any errors it will fall back to sending uncompressed responses.
Definition at line 25 of file ZlibServerFilter.h.
|
inlineexplicit |
Definition at line 27 of file ZlibServerFilter.h.
Referenced by proxygen::ZlibServerFilterFactory::onRequest().
|
inlineprotected |
Definition at line 147 of file ZlibServerFilter.h.
References proxygen::Filter::sendAbort().
Referenced by gtest_xml_test_utils.GTestXMLTestCase::_GetChildren(), fatal_test.FatalTests::is_debug_build(), sendBody(), sendEOM(), and sendHeaders().
|
inlineprotectednoexcept |
Definition at line 165 of file ZlibServerFilter.h.
References compressibleContentTypes_, proxygen::HTTP_HEADER_CONTENT_TYPE, and folly::toLowerAscii().
Referenced by sendHeaders().
|
inlineprotectednoexcept |
Definition at line 152 of file ZlibServerFilter.h.
References proxygen::HTTP_HEADER_CONTENT_LENGTH, minimumCompressionSize_, and uint32_t.
Referenced by sendHeaders().
|
inlineoverridevirtualnoexcept |
Implements proxygen::ResponseHandler.
Definition at line 86 of file ZlibServerFilter.h.
References chunked_, compress_, compressor_, fail(), header_, proxygen::HTTP_HEADER_CONTENT_LENGTH, folly::gen::move, responseMessage_, proxygen::Filter::sendBody(), proxygen::Filter::sendChunkHeader(), and proxygen::Filter::sendHeaders().
|
inlineoverridevirtualnoexcept |
Implements proxygen::ResponseHandler.
Definition at line 71 of file ZlibServerFilter.h.
References compress_, header_, and proxygen::Filter::sendChunkHeader().
|
inlineoverridevirtualnoexcept |
Implements proxygen::ResponseHandler.
Definition at line 122 of file ZlibServerFilter.h.
References chunked_, compress_, compressor_, folly::IOBuf::copyBuffer(), fail(), folly::gen::move, proxygen::Filter::sendBody(), proxygen::Filter::sendChunkHeader(), proxygen::Filter::sendChunkTerminator(), and proxygen::Filter::sendEOM().
|
inlineoverridevirtualnoexcept |
NOTE: We take response message as non-const reference, to allow filters between your handler and client to be able to modify response if they want to.
eg. a compression filter might want to change the content-encoding
Implements proxygen::ResponseHandler.
Definition at line 37 of file ZlibServerFilter.h.
References chunked_, compress_, compressionLevel_, compressor_, fail(), proxygen::GZIP, header_, proxygen::HTTP_HEADER_CONTENT_ENCODING, isCompressibleContentType(), isMinimumCompressibleSize(), responseMessage_, and proxygen::Filter::sendHeaders().
|
protected |
Definition at line 192 of file ZlibServerFilter.h.
Referenced by sendBody(), sendEOM(), and sendHeaders().
|
protected |
Definition at line 193 of file ZlibServerFilter.h.
Referenced by sendBody(), sendChunkHeader(), sendEOM(), and sendHeaders().
|
protected |
Definition at line 190 of file ZlibServerFilter.h.
Referenced by isCompressibleContentType(), and proxygen::ZlibServerFilterFactory::onRequest().
|
protected |
Definition at line 188 of file ZlibServerFilter.h.
Referenced by proxygen::ZlibServerFilterFactory::onRequest(), and sendHeaders().
|
protected |
Definition at line 187 of file ZlibServerFilter.h.
Referenced by sendBody(), sendEOM(), and sendHeaders().
|
protected |
Definition at line 191 of file ZlibServerFilter.h.
Referenced by sendBody(), sendChunkHeader(), and sendHeaders().
|
protected |
Definition at line 189 of file ZlibServerFilter.h.
Referenced by isMinimumCompressibleSize(), and proxygen::ZlibServerFilterFactory::onRequest().
|
protected |
Definition at line 186 of file ZlibServerFilter.h.
Referenced by sendBody(), and sendHeaders().