proxygen
|
#include <HTTPParallelCodec.h>
Protected Types | |
enum | ClosingState { OPEN = 0, OPEN_WITH_GRACEFUL_DRAIN_ENABLED = 1, FIRST_GOAWAY_SENT = 2, CLOSING = 3, CLOSED = 4 } |
Protected Member Functions | |
template<typename T , typename... Args> | |
bool | deliverCallbackIfAllowed (T callbackFn, char const *cbName, StreamID stream, Args &&...args) |
Protected Attributes | |
TransportDirection | transportDirection_ |
StreamID | nextEgressStreamID_ |
StreamID | lastStreamID_ {0} |
HTTPCodec::Callback * | callback_ {nullptr} |
StreamID | ingressGoawayAck_ {std::numeric_limits<uint32_t>::max()} |
StreamID | egressGoawayAck_ {std::numeric_limits<uint32_t>::max()} |
std::string | goawayErrorMessage_ |
enum proxygen::HTTPParallelCodec::ClosingState | sessionClosing_ |
Additional Inherited Members | |
Public Types inherited from proxygen::HTTPCodec | |
using | StreamID = uint64_t |
Static Public Attributes inherited from proxygen::HTTPCodec | |
static const folly::Optional< StreamID > | NoStream |
static const folly::Optional< uint8_t > | NoPadding = folly::none |
static const StreamID | MAX_STREAM_ID = 1u << 31 |
static const folly::Optional< ExAttributes > | NoExAttributes |
An implementation of common codec functionality used for multiple parallel stream downloads. Currently shared by SPDY and HTTP/2
Definition at line 31 of file HTTPParallelCodec.h.
|
protected |
Enumerator | |
---|---|
OPEN | |
OPEN_WITH_GRACEFUL_DRAIN_ENABLED | |
FIRST_GOAWAY_SENT | |
CLOSING | |
CLOSED |
Definition at line 84 of file HTTPParallelCodec.h.
|
explicit |
Definition at line 23 of file HTTPParallelCodec.cpp.
References proxygen::DOWNSTREAM, nextEgressStreamID_, transportDirection_, and proxygen::UPSTREAM.
|
inlineoverridevirtual |
Checks whether the socket needs to be closed when EOM is sent. This is used during CONNECT when EOF needs to be sent after upgrade to notify the server
Implements proxygen::HTTPCodec.
Definition at line 44 of file HTTPParallelCodec.h.
|
overridevirtual |
Reserve a stream ID.
Implements proxygen::HTTPCodec.
Definition at line 38 of file HTTPParallelCodec.cpp.
References nextEgressStreamID_.
Referenced by proxygen::HTTP2Codec::addPriorityNodes(), TEST(), and TEST_F().
|
inlineprotected |
Definition at line 93 of file HTTPParallelCodec.h.
References callback_.
Referenced by proxygen::SPDYCodec::deliverOnMessageBegin(), proxygen::HTTP2Codec::handleEndStream(), proxygen::SPDYCodec::onRstStream(), proxygen::SPDYCodec::onSynCommon(), proxygen::SPDYCodec::onWindowUpdate(), proxygen::HTTP2Codec::parseAllData(), proxygen::HTTP2Codec::parseDataFrameData(), proxygen::HTTP2Codec::parseHeadersImpl(), proxygen::SPDYCodec::parseIngress(), proxygen::HTTP2Codec::parsePriority(), proxygen::HTTP2Codec::parseRstStream(), and proxygen::HTTP2Codec::parseWindowUpdate().
|
overridevirtual |
This enables HTTP/2 style behavior during graceful shutdown that allows 2 GOAWAYs to be sent during shutdown.
Reimplemented from proxygen::HTTPCodec.
Definition at line 58 of file HTTPParallelCodec.cpp.
References sessionClosing_.
Referenced by TEST().
|
inlineoverridevirtual |
Get the identifier of the last stream started by the remote.
Reimplemented from proxygen::HTTPCodec.
Definition at line 50 of file HTTPParallelCodec.h.
|
inlineoverridevirtual |
Get the transport direction of this codec: DOWNSTREAM if the codec receives requests from clients or UPSTREAM if the codec sends requests to servers.
Implements proxygen::HTTPCodec.
Definition at line 35 of file HTTPParallelCodec.h.
Referenced by proxygen::HTTP2Codec::generateSettings(), proxygen::HTTP2Codec::generateSettingsAck(), proxygen::HTTP2Codec::handleSettings(), and HTTPParallelCodecTest::parseImpl().
|
inlineoverridevirtual |
Check whether the codec still has at least one HTTP stream to parse.
Implements proxygen::HTTPCodec.
Definition at line 40 of file HTTPParallelCodec.h.
|
inline |
Definition at line 63 of file HTTPParallelCodec.h.
References odd.
Referenced by proxygen::HTTP2Codec::checkNewStream().
|
overridevirtual |
Check whether the codec can process new streams. Typically, an implementing subclass will return true when a new codec is created and false once it encounters a situation that would prevent reuse of the underlying transport (e.g., a "Connection: close" in HTTP/1.x).
Implements proxygen::HTTPCodec.
Definition at line 49 of file HTTPParallelCodec.cpp.
References proxygen::DOWNSTREAM, ingressGoawayAck_, isWaitingToDrain(), max, nextEgressStreamID_, sessionClosing_, and transportDirection_.
Referenced by TEST(), and TEST_F().
|
inline |
Definition at line 69 of file HTTPParallelCodec.h.
Referenced by proxygen::SPDYCodec::generateBody(), proxygen::HTTP2Codec::generateBody(), proxygen::SPDYCodec::generateEOM(), proxygen::HTTP2Codec::generateEOM(), proxygen::SPDYCodec::generateHeader(), proxygen::HTTP2Codec::generateHeaderImpl(), proxygen::HTTP2Codec::generatePriority(), proxygen::SPDYCodec::generatePushPromise(), proxygen::SPDYCodec::generateRstStream(), proxygen::HTTP2Codec::generateRstStream(), proxygen::SPDYCodec::generateWindowUpdate(), and proxygen::HTTP2Codec::generateWindowUpdate().
|
overridevirtual |
Returns true if this codec is in a state where it accepting new requests but will soon begin to reject new requests. For SPDY and HTTP/2, this is true when the first GOAWAY NO_ERROR is sent during graceful shutdown.
Implements proxygen::HTTPCodec.
Definition at line 44 of file HTTPParallelCodec.cpp.
References sessionClosing_.
Referenced by isReusable(), and TEST().
|
inlineoverridevirtual |
Finish parsing when the ingress stream has ended.
Implements proxygen::HTTPCodec.
Definition at line 47 of file HTTPParallelCodec.h.
|
overridevirtual |
Invoked on a codec that has been upgraded to via an HTTPMessage on a different codec. The codec may return false to halt the upgrade.
Reimplemented from proxygen::HTTPCodec.
Definition at line 63 of file HTTPParallelCodec.cpp.
References proxygen::DOWNSTREAM, lastStreamID_, and transportDirection_.
Referenced by proxygen::HTTP2Codec::onIngressUpgradeMessage().
|
inlineoverridevirtual |
Set the callback to notify on ingress events
callback | The callback object |
Implements proxygen::HTTPCodec.
Definition at line 45 of file HTTPParallelCodec.h.
References callback_.
Referenced by parseSPDY(), HTTPParallelCodecTest::SetUp(), TEST(), and TEST_F().
|
inline |
Definition at line 55 of file HTTPParallelCodec.h.
References max.
Referenced by TEST(), and TEST_F().
|
inlineoverridevirtual |
Pause or resume the ingress parser
paused | Whether the caller wants the parser to be paused |
Implements proxygen::HTTPCodec.
Definition at line 46 of file HTTPParallelCodec.h.
|
inlineoverridevirtual |
Check whether the codec supports the processing of multiple requests in parallel.
Implements proxygen::HTTPCodec.
Definition at line 43 of file HTTPParallelCodec.h.
|
inlineoverridevirtual |
Returns true iff this codec supports session level flow control
Reimplemented from proxygen::HTTPCodec.
Reimplemented in proxygen::SPDYCodec.
Definition at line 42 of file HTTPParallelCodec.h.
|
inlineoverridevirtual |
Returns true iff this codec supports per stream flow control
Reimplemented from proxygen::HTTPCodec.
Reimplemented in proxygen::SPDYCodec.
Definition at line 41 of file HTTPParallelCodec.h.
|
protected |
Definition at line 79 of file HTTPParallelCodec.h.
Referenced by proxygen::HTTP2Codec::checkConnectionError(), proxygen::SPDYCodec::failSession(), proxygen::SPDYCodec::failStream(), proxygen::HTTP2Codec::generateHeaderCallbackWrapper(), proxygen::HTTP2Codec::handleSettings(), proxygen::SPDYCodec::onGoaway(), proxygen::HTTP2Codec::onIngress(), proxygen::SPDYCodec::onPing(), proxygen::SPDYCodec::onSettings(), proxygen::SPDYCodec::onSynStream(), proxygen::HTTP2Codec::parseAllData(), proxygen::HTTP2Codec::parseCertificate(), proxygen::HTTP2Codec::parseCertificateRequest(), proxygen::HTTP2Codec::parseDataFrameData(), proxygen::HTTP2Codec::parseGoaway(), proxygen::HTTP2Codec::parseHeadersCheckConcurrentStreams(), proxygen::HTTP2Codec::parseHeadersDecodeFrames(), proxygen::HTTP2Codec::parseHeadersImpl(), proxygen::SPDYCodec::parseIngress(), proxygen::HTTP2Codec::parsePing(), proxygen::HTTP2Codec::parseSettings(), and proxygen::HTTP2Codec::streamError().
|
protected |
Definition at line 81 of file HTTPParallelCodec.h.
Referenced by proxygen::SPDYCodec::generateGoaway(), and proxygen::HTTP2Codec::generateGoaway().
|
protected |
Definition at line 82 of file HTTPParallelCodec.h.
Referenced by proxygen::HTTP2Codec::checkConnectionError(), proxygen::HTTP2Codec::checkNewStream(), proxygen::HTTP2Codec::handleSettings(), proxygen::HTTP2Codec::onIngress(), proxygen::HTTP2Codec::parseFrame(), proxygen::HTTP2Codec::parsePushPromise(), proxygen::HTTP2Codec::parseRstStream(), and proxygen::HTTP2Codec::parseWindowUpdate().
|
protected |
Definition at line 80 of file HTTPParallelCodec.h.
Referenced by proxygen::SPDYCodec::generateBody(), proxygen::HTTP2Codec::generateBody(), proxygen::SPDYCodec::generateEOM(), proxygen::HTTP2Codec::generateEOM(), proxygen::SPDYCodec::generateHeader(), proxygen::HTTP2Codec::generateHeaderImpl(), proxygen::HTTP2Codec::generatePriority(), proxygen::SPDYCodec::generatePushPromise(), proxygen::SPDYCodec::generateRstStream(), proxygen::HTTP2Codec::generateRstStream(), proxygen::SPDYCodec::generateWindowUpdate(), proxygen::HTTP2Codec::generateWindowUpdate(), isReusable(), proxygen::SPDYCodec::onGoaway(), and proxygen::HTTP2Codec::parseGoaway().
|
protected |
Definition at line 78 of file HTTPParallelCodec.h.
Referenced by proxygen::HTTP2Codec::checkNewStream(), proxygen::SPDYCodec::failSession(), onIngressUpgradeMessage(), and proxygen::SPDYCodec::onSynStream().
|
protected |
Definition at line 77 of file HTTPParallelCodec.h.
Referenced by createStream(), HTTPParallelCodec(), isReusable(), and proxygen::SPDYCodec::SPDYCodec().
|
protected |
|
protected |
Definition at line 76 of file HTTPParallelCodec.h.
Referenced by proxygen::HTTP2Codec::generateConnectionPreface(), proxygen::SPDYCodec::generateHeader(), proxygen::HTTP2Codec::generateHeaderImpl(), proxygen::HTTP2Codec::generateSettings(), proxygen::HTTP2Codec::handleSettings(), HTTPParallelCodec(), proxygen::HTTP2Codec::isRequest(), isReusable(), proxygen::SPDYCodec::isSPDYReserved(), proxygen::HTTP2Codec::onHeader(), proxygen::HTTP2Codec::onHeadersComplete(), onIngressUpgradeMessage(), proxygen::SPDYCodec::onPing(), proxygen::SPDYCodec::onSynCommon(), proxygen::SPDYCodec::onSynReply(), proxygen::SPDYCodec::onSynStream(), proxygen::HTTP2Codec::parseHeaders(), proxygen::HTTP2Codec::parseHeadersDecodeFrames(), proxygen::HTTP2Codec::parseHeadersImpl(), proxygen::HTTP2Codec::parsePushPromise(), proxygen::HTTP2Codec::parsingTrailers(), and proxygen::HTTP2Codec::supportsPushTransactions().