proxygen
|
Classes | |
struct | FrameHeader |
struct | PriorityUpdate |
Typedefs | |
using | Padding = folly::Optional< uint8_t > |
Enumerations | |
enum | FrameType : uint8_t { FrameType::DATA = 0, FrameType::HEADERS = 1, PRIORITY = 2, FrameType::RST_STREAM = 3, FrameType::SETTINGS = 4, FrameType::PUSH_PROMISE = 5, FrameType::PING = 6, FrameType::GOAWAY = 7, FrameType::WINDOW_UPDATE = 8, FrameType::CONTINUATION = 9, FrameType::ALTSVC = 10, FrameType::EX_HEADERS = 0xfb, FrameType::CERTIFICATE_REQUEST = 0xf0, FrameType::CERTIFICATE = 0xf1, FrameType::CERTIFICATE_NEEDED = 0xf2, FrameType::USE_CERTIFICATE = 0xf3 } |
enum | Flags { ACK = 0x1, END_STREAM = 0x1, END_HEADERS = 0x4, PADDED = 0x8, PRIORITY = 0x20, PRIORITY = 2, UNIDIRECTIONAL = 0x40, UNSOLICITED = 0x1, TO_BE_CONTINUED = 0x1 } |
Functions | |
ErrorCode | filterInvalidStream (ErrorCode code) |
ErrorCode | errorCodeToGoaway (ErrorCode code) |
ErrorCode | errorCodeToReset (ErrorCode code) |
const std::string | kConnectionPreface ("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n") |
const std::string | kProtocolString ("h2") |
const std::string | kProtocolDraftString ("h2-14") |
const std::string | kProtocolExperimentalString ("h2-fb") |
const std::string | kProtocolCleartextString ("h2c") |
const std::string | kProtocolSettingsHeader ("HTTP2-Settings") |
bool | isValidFrameType (FrameType type) |
bool | frameAffectsCompression (FrameType t) |
bool | frameHasPadding (const FrameHeader &header) |
ErrorCode | parseFrameHeader (Cursor &cursor, FrameHeader &header) noexcept |
ErrorCode | parseData (Cursor &cursor, const FrameHeader &header, std::unique_ptr< IOBuf > &outBuf, uint16_t &outPadding) noexcept |
ErrorCode | parseDataBegin (Cursor &cursor, const FrameHeader &header, size_t &, uint16_t &outPadding) noexcept |
ErrorCode | parseDataEnd (Cursor &cursor, const size_t bufLen, const size_t pendingDataFramePaddingBytes, size_t &toSkip) noexcept |
ErrorCode | parseHeaders (Cursor &cursor, const FrameHeader &header, folly::Optional< PriorityUpdate > &outPriority, std::unique_ptr< IOBuf > &outBuf) noexcept |
ErrorCode | parseExHeaders (Cursor &cursor, const FrameHeader &header, HTTPCodec::ExAttributes &outExAttributes, folly::Optional< PriorityUpdate > &outPriority, std::unique_ptr< IOBuf > &outBuf) noexcept |
ErrorCode | parsePriority (Cursor &cursor, const FrameHeader &header, PriorityUpdate &outPriority) noexcept |
ErrorCode | parseRstStream (Cursor &cursor, const FrameHeader &header, ErrorCode &outCode) noexcept |
ErrorCode | parseSettings (Cursor &cursor, const FrameHeader &header, std::deque< SettingPair > &settings) noexcept |
ErrorCode | parsePushPromise (Cursor &cursor, const FrameHeader &header, uint32_t &outPromisedStream, std::unique_ptr< IOBuf > &outBuf) noexcept |
ErrorCode | parsePing (Cursor &cursor, const FrameHeader &header, uint64_t &outOpaqueData) noexcept |
ErrorCode | parseGoaway (Cursor &cursor, const FrameHeader &header, uint32_t &outLastStreamID, ErrorCode &outCode, std::unique_ptr< IOBuf > &outDebugData) noexcept |
ErrorCode | parseWindowUpdate (Cursor &cursor, const FrameHeader &header, uint32_t &outAmount) noexcept |
ErrorCode | parseContinuation (Cursor &cursor, const FrameHeader &header, std::unique_ptr< IOBuf > &outBuf) noexcept |
ErrorCode | parseAltSvc (Cursor &cursor, const FrameHeader &header, uint32_t &outMaxAge, uint32_t &outPort, std::string &outProtocol, std::string &outHost, std::string &outOrigin) noexcept |
ErrorCode | parseCertificateRequest (folly::io::Cursor &cursor, const FrameHeader &header, uint16_t &outRequestId, std::unique_ptr< folly::IOBuf > &outAuthRequest) noexcept |
ErrorCode | parseCertificate (folly::io::Cursor &cursor, const FrameHeader &header, uint16_t &outCertId, std::unique_ptr< folly::IOBuf > &outAuthenticator) noexcept |
size_t | writeData (IOBufQueue &queue, std::unique_ptr< IOBuf > data, uint32_t stream, folly::Optional< uint8_t > padding, bool endStream, bool reuseIOBufHeadroom) noexcept |
size_t | writeHeaders (IOBufQueue &queue, std::unique_ptr< IOBuf > headers, uint32_t stream, folly::Optional< PriorityUpdate > priority, folly::Optional< uint8_t > padding, bool endStream, bool endHeaders) noexcept |
size_t | writeExHeaders (IOBufQueue &queue, std::unique_ptr< IOBuf > headers, uint32_t stream, const HTTPCodec::ExAttributes &exAttributes, const folly::Optional< PriorityUpdate > &priority, const folly::Optional< uint8_t > &padding, bool endStream, bool endHeaders) noexcept |
size_t | writePriority (IOBufQueue &queue, uint32_t stream, PriorityUpdate priority) noexcept |
size_t | writeRstStream (IOBufQueue &queue, uint32_t stream, ErrorCode errorCode) noexcept |
size_t | writeSettings (IOBufQueue &queue, const std::deque< SettingPair > &settings) |
size_t | writeSettingsAck (IOBufQueue &queue) |
size_t | writePushPromise (IOBufQueue &queue, uint32_t associatedStream, uint32_t promisedStream, std::unique_ptr< IOBuf > headers, folly::Optional< uint8_t > padding, bool endHeaders) noexcept |
size_t | writePing (IOBufQueue &queue, uint64_t opaqueData, bool ack) noexcept |
size_t | writeGoaway (IOBufQueue &queue, uint32_t lastStreamID, ErrorCode errorCode, std::unique_ptr< IOBuf > debugData) noexcept |
size_t | writeWindowUpdate (IOBufQueue &queue, uint32_t stream, uint32_t amount) noexcept |
size_t | writeContinuation (IOBufQueue &queue, uint32_t stream, bool endHeaders, std::unique_ptr< IOBuf > headers) noexcept |
size_t | writeAltSvc (IOBufQueue &queue, uint32_t stream, uint32_t maxAge, uint16_t port, StringPiece protocol, StringPiece host, StringPiece origin) noexcept |
size_t | writeCertificateRequest (folly::IOBufQueue &writeBuf, uint16_t requestId, std::unique_ptr< folly::IOBuf > authRequest) |
size_t | writeCertificate (folly::IOBufQueue &writeBuf, uint16_t certId, std::unique_ptr< folly::IOBuf > authenticator, bool toBeContinued) |
const char * | getFrameTypeString (FrameType type) |
using proxygen::http2::Padding = typedef folly::Optional<uint8_t> |
Definition at line 30 of file HTTP2Framer.h.
Enumerator | |
---|---|
ACK | |
END_STREAM | |
END_HEADERS | |
PADDED | |
PRIORITY | |
PRIORITY | |
UNIDIRECTIONAL | |
UNSOLICITED | |
TO_BE_CONTINUED |
Definition at line 59 of file HTTP2Framer.h.
|
strong |
Enumerator | |
---|---|
DATA | |
HEADERS | |
PRIORITY | |
RST_STREAM | |
SETTINGS | |
PUSH_PROMISE | |
PING | |
GOAWAY | |
WINDOW_UPDATE | |
CONTINUATION | |
ALTSVC | |
EX_HEADERS | |
CERTIFICATE_REQUEST | |
CERTIFICATE | |
CERTIFICATE_NEEDED | |
USE_CERTIFICATE |
Definition at line 35 of file HTTP2Framer.h.
Definition at line 22 of file HTTP2Constants.cpp.
References filterInvalidStream().
Referenced by proxygen::HTTP2Codec::generateGoaway().
Definition at line 26 of file HTTP2Constants.cpp.
References filterInvalidStream().
Referenced by proxygen::HTTP2Codec::generateRstStream().
Definition at line 14 of file HTTP2Constants.cpp.
References proxygen::_SPDY_INVALID_STREAM, and proxygen::STREAM_CLOSED.
Referenced by errorCodeToGoaway(), and errorCodeToReset().
bool proxygen::http2::frameAffectsCompression | ( | FrameType | t | ) |
Definition at line 244 of file HTTP2Framer.cpp.
References proxygen::spdy::HEADERS.
Referenced by proxygen::HTTP2Codec::parseFrame().
bool proxygen::http2::frameHasPadding | ( | const FrameHeader & | header | ) |
This function returns true if the padding bit is set in the header
header | The frame header. |
Definition at line 250 of file HTTP2Framer.cpp.
References proxygen::http2::FrameHeader::flags, and PADDED.
Referenced by parseData(), parseDataBegin(), and proxygen::HTTP2Codec::parseDataFrameData().
const char * proxygen::http2::getFrameTypeString | ( | FrameType | type | ) |
Get the string representation of the given FrameType
type | frame type |
Definition at line 963 of file HTTP2Framer.cpp.
References folly::FATAL, proxygen::spdy::GOAWAY, proxygen::spdy::HEADERS, proxygen::spdy::PING, PRIORITY, proxygen::spdy::RST_STREAM, proxygen::spdy::SETTINGS, and proxygen::spdy::WINDOW_UPDATE.
Referenced by proxygen::HTTP2Codec::onIngress(), and proxygen::HTTP2Codec::parseFrame().
bool proxygen::http2::isValidFrameType | ( | FrameType | type | ) |
Definition at line 226 of file HTTP2Framer.cpp.
References type, uint8_t, and val.
const std::string proxygen::http2::kConnectionPreface | ( | "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" | ) |
const std::string proxygen::http2::kProtocolCleartextString | ( | "h2c" | ) |
const std::string proxygen::http2::kProtocolDraftString | ( | "h2-14" | ) |
const std::string proxygen::http2::kProtocolExperimentalString | ( | "h2-fb" | ) |
const std::string proxygen::http2::kProtocolSettingsHeader | ( | "HTTP2-Settings" | ) |
const std::string proxygen::http2::kProtocolString | ( | "h2" | ) |
|
noexcept |
This function parses the section of the ALTSVC frame after the common frame header. The caller must ensure there is header.length bytes available in the cursor.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outMaxAge | The max age field. |
outPort | The port the alternative service is on. |
outProtocol | The alternative service protocol string. |
outHost | The alternative service host name. |
outOrigin | The origin the alternative service is applicable to. |
Definition at line 533 of file HTTP2Framer.cpp.
References kFrameAltSvcSizeBase, uint16_t, uint32_t, and uint8_t.
Referenced by TEST_F().
|
noexcept |
This function parses the section of the CERTIFICATE frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outCertId | The Cert-ID identifying the frame. |
outAuthenticator | Authenticator fragment in the frame, if any. |
Definition at line 586 of file HTTP2Framer.cpp.
References kFrameCertificateSizeBase, and uint16_t.
Referenced by proxygen::HTTP2Codec::parseCertificate(), and TEST_F().
|
noexcept |
This function parses the section of the CERTIFICATE_REQUEST frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outRequestId | The Request-ID identifying this certificate request. |
outAuthRequest | Authenticator request in the frame, if any. |
Definition at line 565 of file HTTP2Framer.cpp.
References kFrameCertificateRequestSizeBase, and uint16_t.
Referenced by proxygen::HTTP2Codec::parseCertificateRequest(), and TEST_F().
|
noexcept |
This function parses the section of the CONTINUATION frame after the common frame header. The caller must ensure there is header.length bytes available in the cursor.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outBuf | The buffer to fill with header data. |
outAmount | The amount to increment the stream's window by. |
Definition at line 520 of file HTTP2Framer.cpp.
Referenced by proxygen::HTTP2Codec::parseContinuation(), and TEST_F().
|
noexcept |
This function parses the section of the DATA frame after the common frame header. It discards any padding and returns the body data in outBuf. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outBuf | The buf to fill with body data. |
padding | The number of padding bytes in this data frame |
Definition at line 270 of file HTTP2Framer.cpp.
References frameHasPadding(), RETURN_IF_ERROR, uint32_t, and uint8_t.
Referenced by HTTP2FramerTest::dataFrameTest(), proxygen::HTTP2Codec::parseAllData(), and TEST_F().
|
noexcept |
Definition at line 290 of file HTTP2Framer.cpp.
References frameHasPadding(), RETURN_IF_ERROR, uint32_t, and uint8_t.
Referenced by proxygen::HTTP2Codec::parseDataFrameData().
|
noexcept |
Definition at line 304 of file HTTP2Framer.cpp.
References min.
Referenced by proxygen::HTTP2Codec::parseDataFrameData().
|
noexcept |
Definition at line 339 of file HTTP2Framer.cpp.
References kFramePrioritySize, kFrameStreamIDSize, folly::none, PRIORITY, RETURN_IF_ERROR, uint32_t, uint8_t, and UNIDIRECTIONAL.
Referenced by proxygen::HTTP2Codec::parseExHeaders(), and TEST_F().
|
noexcept |
This function parses the common HTTP/2 frame header. This function pulls kFrameHeaderSize bytes from the cursor, so the caller must check that that amount is available.
cursor | The cursor to pull data from. |
header | The frame header struct to populate. |
Definition at line 256 of file HTTP2Framer.cpp.
References FOLLY_SCOPED_TRACE_SECTION, kFrameHeaderSize, type, uint32_t, and uint8_t.
Referenced by proxygen::HTTP2Codec::onIngress(), HTTP2FramerTest::parse(), and TEST_F().
|
noexcept |
This function parses the section of the GOAWAY frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outLastStreamID | The last stream id accepted by the remote. |
outCode | The error code received in the frame. |
outDebugData | Additional debug-data in the frame, if any |
Definition at line 484 of file HTTP2Framer.cpp.
References kFrameGoawaySize, and RETURN_IF_ERROR.
Referenced by proxygen::HTTP2Codec::parseGoaway(), and TEST_F().
|
noexcept |
This function parses the section of the HEADERS frame after the common frame header. It discards any padding and returns the header data in outBuf. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outPriority | If PRIORITY flag is set, this will be filled with the priority information from this frame. |
outBuf | The buf to fill with header data. |
Definition at line 313 of file HTTP2Framer.cpp.
References kFramePrioritySize, folly::none, PRIORITY, RETURN_IF_ERROR, uint32_t, and uint8_t.
Referenced by proxygen::HTTP2Codec::parseHeaders(), and TEST_F().
|
noexcept |
This function parses the section of the PING frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outData | The opaque data from the ping frame |
Definition at line 467 of file HTTP2Framer.cpp.
References kFramePingSize.
Referenced by proxygen::HTTP2Codec::parsePing(), and TEST_F().
|
noexcept |
This function parses the section of the PRIORITY frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outPriority | On success, filled with the priority information from this frame. |
Definition at line 381 of file HTTP2Framer.cpp.
References kFramePrioritySize.
Referenced by proxygen::HTTP2Codec::parsePriority(), and TEST_F().
|
noexcept |
This function parses the section of the PUSH_PROMISE frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outPromisedStream | The id of the stream promised by the remote. |
outBuf | The buffer to fill with header data. |
Definition at line 436 of file HTTP2Framer.cpp.
References kFramePushPromiseSize, RETURN_IF_ERROR, uint32_t, and uint8_t.
Referenced by proxygen::HTTP2Codec::parsePushPromise(), and TEST_F().
|
noexcept |
This function parses the section of the RST_STREAM frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outCode | The error code received in the frame. |
Definition at line 396 of file HTTP2Framer.cpp.
References kFrameRstStreamSize.
Referenced by proxygen::HTTP2Codec::parseRstStream(), and TEST_F().
|
noexcept |
This function parses the section of the SETTINGS frame after the common frame header. It pulls header.length bytes from the cursor, so it is the caller's responsibility to ensure there is enough data available.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
settings | The settings received in this frame. |
Definition at line 410 of file HTTP2Framer.cpp.
References ACK, settings, uint16_t, uint32_t, and val.
Referenced by proxygen::HTTP2Codec::onIngressUpgradeMessage(), proxygen::HTTP2Codec::parseSettings(), and TEST_F().
|
noexcept |
This function parses the section of the WINDOW_UPDATE frame after the common frame header. The caller must ensure there is header.length bytes available in the cursor.
cursor | The cursor to pull data from. |
header | The frame header for the frame being parsed. |
outAmount | The amount to increment the stream's window by. |
Definition at line 508 of file HTTP2Framer.cpp.
References kFrameWindowUpdateSize.
Referenced by proxygen::HTTP2Codec::parseWindowUpdate(), and TEST_F().
|
noexcept |
Generate an entire ALTSVC frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
stream | The stream to do Alt-Svc on. May be zero. |
maxAge | The max age field. |
port | The port the alternative service is on. |
protocol | The alternative service protocol string. |
host | The alternative service host name. |
origin | The origin the alternative service is applicable to. |
Definition at line 890 of file HTTP2Framer.cpp.
References kFrameAltSvcSizeBase, kFrameHeaderSize, folly::none, folly::io::detail::Writable< Derived >::push(), uint16_t, uint32_t, uint8_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by TEST_F().
size_t proxygen::http2::writeCertificate | ( | folly::IOBufQueue & | writeBuf, |
uint16_t | certId, | ||
std::unique_ptr< folly::IOBuf > | authenticator, | ||
bool | toBeContinued | ||
) |
Generate an entire CERTIFICATE frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
certId | The opaque Cert-ID of this frame which is used to correlate subsequent certificate-related frames with this certificate. |
authenticator | The encoded authenticator fragment. |
toBeContinued | Indicates whether there is additional authenticator fragment. |
Definition at line 936 of file HTTP2Framer.cpp.
References folly::IOBufQueue::append(), folly::IOBuf::computeChainDataLength(), kFrameCertificateSizeBase, kFrameHeaderSize, folly::gen::move, folly::none, TO_BE_CONTINUED, uint16_t, uint8_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateCertificate(), and TEST_F().
size_t proxygen::http2::writeCertificateRequest | ( | folly::IOBufQueue & | writeBuf, |
uint16_t | requestId, | ||
std::unique_ptr< folly::IOBuf > | authRequest | ||
) |
Generate an entire CERTIFICATE_REQUEST frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
requestId | The opaque Request-ID of this used to correlate subsequent certificate-related frames with this request. |
authRequest | The encoded authenticator request. |
Definition at line 915 of file HTTP2Framer.cpp.
References folly::IOBufQueue::append(), folly::IOBuf::computeChainDataLength(), kFrameCertificateRequestSizeBase, kFrameHeaderSize, folly::gen::move, folly::none, uint16_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateCertificateRequest(), and TEST_F().
|
noexcept |
Generate an entire CONTINUATION frame, including the common frame header. The combined length of the data buffer and the padding MUST NOT exceed 2^14 - 3, which is kMaxFramePayloadLength minus the two bytes to encode the length of the padding.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
stream | The stream identifier of the DATA frame. |
endHeaders | True iff more CONTINUATION frames will follow. |
headers | The encoded headers data to write out. |
Definition at line 872 of file HTTP2Framer.cpp.
References END_HEADERS, kFrameHeaderSize, folly::gen::move, and folly::none.
Referenced by proxygen::HTTP2Codec::generateContinuation(), and TEST_F().
|
noexcept |
Generate an entire DATA frame, including the common frame header. The combined length of the data buffer, the padding, and the padding length MUST NOT exceed 2^14 - 1, which is kMaxFramePayloadLength.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
data | The body data to write out, can be nullptr for 0 length |
stream | The stream identifier of the DATA frame. |
padding | If not kNoPadding, adds 1 byte pad len and pad bytes |
endStream | True iff this frame ends the stream. |
reuseIOBufHeadroom | If HTTP2Framer should reuse headroom in data if headroom is enough for frame header |
Definition at line 610 of file HTTP2Framer.cpp.
References folly::data(), END_STREAM, kFrameHeaderSize, folly::gen::move, folly::none, uint64_t, and uint8_t.
Referenced by HTTP2FramerTest::dataFrameTest(), proxygen::HTTP2Codec::generateBody(), proxygen::HTTP2Codec::generateEOM(), and TEST_F().
|
noexcept |
Generate an experimental ExHEADERS frame, including the common frame header. The combined length of the data buffer and the padding and priority fields MUST NOT exceed 2^14 - 1, which is kMaxFramePayloadLength.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
headers | The encoded headers data to write out. |
stream | The stream identifier of the ExHEADERS frame. |
exAttributes | Attributes specific to ExHEADERS frame. |
priority | If present, the priority depedency information to update the stream with. |
padding | If not kNoPadding, adds 1 byte pad len and pad bytes |
endStream | True iff this frame ends the stream. |
endHeaders | True iff no CONTINUATION frames will follow this frame. |
Definition at line 671 of file HTTP2Framer.cpp.
References END_HEADERS, END_STREAM, kFrameHeaderSize, kFrameStreamIDSize, folly::gen::move, PRIORITY, uint32_t, UNIDIRECTIONAL, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateHeaderImpl(), and TEST_F().
|
noexcept |
Generate an entire GOAWAY frame, including the common frame header. We do not implement the optional opaque data.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
lastStreamID | The identifier of the last stream accepted. |
errorCode | The error code returned in the frame. |
debugData | Optional debug information to add to the frame |
Definition at line 831 of file HTTP2Framer.cpp.
References proxygen::spdy::GOAWAY, kFrameGoawaySize, kFrameHeaderSize, folly::gen::move, folly::none, uint32_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateGoaway(), and TEST_F().
|
noexcept |
Generate an entire HEADERS frame, including the common frame header. The combined length of the data buffer and the padding and priority fields MUST NOT exceed 2^14 - 1, which is kMaxFramePayloadLength.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
headers | The encoded headers data to write out. |
stream | The stream identifier of the HEADERS frame. |
priority | If present, the priority depedency information to update the stream with. |
padding | If not kNoPadding, adds 1 byte pad len and pad bytes |
endStream | True iff this frame ends the stream. |
endHeaders | True iff no CONTINUATION frames will follow this frame. |
Definition at line 638 of file HTTP2Framer.cpp.
References END_HEADERS, END_STREAM, proxygen::spdy::HEADERS, kFrameHeaderSize, folly::gen::move, PRIORITY, and uint32_t.
Referenced by proxygen::HTTP2Codec::generateHeaderImpl(), proxygen::HTTP2Codec::generateTrailers(), and TEST_F().
|
noexcept |
Generate an entire PING frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
data | The opaque data to include. |
ack | True iff this is a ping response. |
Definition at line 815 of file HTTP2Framer.cpp.
References ACK, kFrameHeaderSize, kFramePingSize, folly::none, and proxygen::spdy::PING.
Referenced by proxygen::HTTP2Codec::generatePingReply(), proxygen::HTTP2Codec::generatePingRequest(), UDPClient::sendPing(), and TEST_F().
|
noexcept |
Generate an entire PRIORITY frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
stream | The stream identifier of the DATA frame. |
priority | The priority depedency information to update the stream with. |
Definition at line 717 of file HTTP2Framer.cpp.
References kFrameHeaderSize, kFramePrioritySize, and PRIORITY.
Referenced by proxygen::HTTP2Codec::generatePriority(), and TEST_F().
|
noexcept |
Writes an entire PUSH_PROMISE frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
associatedStream | The identifier of the stream the promised stream is associated with. |
promisedStream | The identifier of the promised stream. |
headers | The encoded headers to include in the push promise frame. |
padding | If not kNoPadding, adds 1 byte pad len and pad bytes |
endHeaders | True iff no CONTINUATION frames will follow this frame. |
Definition at line 786 of file HTTP2Framer.cpp.
References END_HEADERS, kFrameHeaderSize, kFramePushPromiseSize, folly::gen::move, folly::none, uint32_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateHeaderImpl(), and TEST_F().
|
noexcept |
Generate an entire RST_STREAM frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
stream | The identifier of the stream to reset. |
errorCode | The error code returned in the frame. |
Definition at line 733 of file HTTP2Framer.cpp.
References kFrameHeaderSize, kFrameRstStreamSize, folly::none, proxygen::spdy::RST_STREAM, uint32_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateRstStream(), and TEST_F().
size_t proxygen::http2::writeSettings | ( | folly::IOBufQueue & | writeBuf, |
const std::deque< SettingPair > & | settings | ||
) |
Generate an entire SETTINGS frame, including the common frame header.
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
settings | The settings to send |
Definition at line 751 of file HTTP2Framer.cpp.
References kFrameHeaderSize, max, folly::none, proxygen::spdy::SETTINGS, uint16_t, uint32_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateSettings(), and TEST_F().
size_t proxygen::http2::writeSettingsAck | ( | folly::IOBufQueue & | writeBuf | ) |
Writes an entire empty SETTINGS frame, including the common frame header. No settings can be transmitted with this frame.
Definition at line 773 of file HTTP2Framer.cpp.
References ACK, kFrameHeaderSize, folly::none, and proxygen::spdy::SETTINGS.
Referenced by proxygen::HTTP2Codec::generateSettingsAck(), and TEST_F().
|
noexcept |
Generate an entire WINDOW_UPDATE frame, including the common frame header. |amount| MUST be between 1 to 2^31 - 1 inclusive
writeBuf | The output queue to write to. It may grow or add underlying buffers inside this function. |
stream | The stream to send a WINDOW_UPDATE on |
amount | The number of bytes to AK |
Definition at line 853 of file HTTP2Framer.cpp.
References kFrameHeaderSize, kFrameWindowUpdateSize, folly::none, uint32_t, proxygen::spdy::WINDOW_UPDATE, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by proxygen::HTTP2Codec::generateWindowUpdate(), and TEST_F().
FB_EXPORT const PriorityUpdate proxygen::http2::DefaultPriority {0, false, 15} |
Definition at line 21 of file HTTP2Framer.cpp.
Referenced by proxygen::HTTP2PriorityQueue::addTransaction(), proxygen::HTTPSession::getMessagePriority(), proxygen::HTTPSession::sessionByteOffset(), and proxygen::HTTP2PriorityQueue::updatePriority().
const std::string proxygen::http2::kConnectionPreface |
Referenced by proxygen::HTTP2Codec::generateConnectionPreface(), proxygen::HTTP2Codec::onIngress(), and TEST_F().
const uint32_t proxygen::http2::kFrameAltSvcSizeBase = 8 |
Definition at line 43 of file HTTP2Constants.cpp.
Referenced by parseAltSvc(), and writeAltSvc().
const uint32_t proxygen::http2::kFrameCertificateRequestSizeBase = 2 |
Definition at line 40 of file HTTP2Constants.cpp.
Referenced by parseCertificateRequest(), TEST_F(), and writeCertificateRequest().
const uint32_t proxygen::http2::kFrameCertificateSizeBase = 2 |
Definition at line 41 of file HTTP2Constants.cpp.
Referenced by parseCertificate(), TEST_F(), and writeCertificate().
const uint32_t proxygen::http2::kFrameGoawaySize = 8 |
Definition at line 38 of file HTTP2Constants.cpp.
Referenced by parseGoaway(), TEST_F(), and writeGoaway().
const uint32_t proxygen::http2::kFrameHeadersBaseMaxSize = kFramePrioritySize + 1 |
Definition at line 32 of file HTTP2Constants.cpp.
Referenced by proxygen::HTTP2Codec::encodeHeaders().
const uint32_t proxygen::http2::kFrameHeaderSize = 9 |
Definition at line 30 of file HTTP2Constants.cpp.
Referenced by proxygen::HTTP2Codec::encodeHeaders(), proxygen::HTTP2Codec::onIngress(), parseFrameHeader(), proxygen::HTTP2Codec::requestUpgrade(), TEST_F(), writeAltSvc(), writeCertificate(), writeCertificateRequest(), writeContinuation(), writeData(), writeExHeaders(), writeFrameHeaderManual(), writeGoaway(), writeHeaders(), writePing(), writePriority(), writePushPromise(), writeRstStream(), writeSettings(), writeSettingsAck(), and writeWindowUpdate().
const uint32_t proxygen::http2::kFramePingSize = 8 |
Definition at line 37 of file HTTP2Constants.cpp.
Referenced by parsePing(), and writePing().
const uint32_t proxygen::http2::kFramePrioritySize = 5 |
Definition at line 33 of file HTTP2Constants.cpp.
Referenced by proxygen::HTTP2Codec::generateHeaderImpl(), parseExHeaders(), parseHeaders(), parsePriority(), TEST_F(), and writePriority().
const uint32_t proxygen::http2::kFramePushPromiseSize = 4 |
Definition at line 36 of file HTTP2Constants.cpp.
Referenced by parsePushPromise(), and writePushPromise().
const uint32_t proxygen::http2::kFrameRstStreamSize = 4 |
Definition at line 35 of file HTTP2Constants.cpp.
Referenced by parseRstStream(), TEST_F(), and writeRstStream().
const uint32_t proxygen::http2::kFrameStreamIDSize = 4 |
Definition at line 34 of file HTTP2Constants.cpp.
Referenced by parseExHeaders(), and writeExHeaders().
const uint32_t proxygen::http2::kFrameWindowUpdateSize = 4 |
Definition at line 39 of file HTTP2Constants.cpp.
Referenced by parseWindowUpdate(), TEST_F(), and writeWindowUpdate().
const uint32_t proxygen::http2::kInitialWindow = (1u << 16) - 1 |
Definition at line 48 of file HTTP2Constants.cpp.
Referenced by proxygen::SPDYCodec::getDefaultWindowSize(), proxygen::HTTP2Codec::getDefaultWindowSize(), SPDY31DownstreamTest::SPDY31DownstreamTest(), TEST(), TEST_F(), and MockCodecDownstreamTest::testConnFlowControlBlocked().
const uint32_t proxygen::http2::kMaxAuthenticatorBufSize = 0x20000 |
Definition at line 52 of file HTTP2Constants.cpp.
Referenced by proxygen::HTTP2Codec::parseCertificate().
const uint32_t proxygen::http2::kMaxFramePayloadLength = (1u << 24) - 1 |
Definition at line 46 of file HTTP2Constants.cpp.
Referenced by HTTP2FramerTest::dataFrameTest(), proxygen::HTTP2Codec::handleSettings(), proxygen::HTTP2Codec::onIngressUpgradeMessage(), and TEST_F().
const uint32_t proxygen::http2::kMaxFramePayloadLengthMin = (1u << 14) |
Definition at line 45 of file HTTP2Constants.cpp.
Referenced by proxygen::getBigGetRequest(), proxygen::HTTP2Codec::handleSettings(), proxygen::HTTP2Codec::maxRecvFrameSize(), proxygen::HTTP2Codec::maxSendFrameSize(), TEST_F(), and HTTP2CodecTest::testFrameSizeLimit().
const uint32_t proxygen::http2::kMaxHeaderTableSize = (1u << 16) |
Definition at line 50 of file HTTP2Constants.cpp.
Referenced by proxygen::HTTP2Codec::handleSettings().
const uint32_t proxygen::http2::kMaxStreamID = (1u << 31) - 1 |
Definition at line 47 of file HTTP2Constants.cpp.
const uint32_t proxygen::http2::kMaxWindowUpdateSize = (1u << 31) - 1 |
Definition at line 49 of file HTTP2Constants.cpp.
Referenced by proxygen::HTTP2Codec::handleSettings(), and TEST_F().
const uint8_t proxygen::http2::kMinExperimentalFrameType = 0xf0 |
Definition at line 19 of file HTTP2Framer.cpp.
const Padding proxygen::http2::kNoPadding = folly::none |
Definition at line 20 of file HTTP2Framer.cpp.
Referenced by proxygen::HTTP2Codec::generateEOM(), proxygen::HTTP2Codec::generateHeaderImpl(), proxygen::HTTP2Codec::generateTrailers(), and TEST_F().
const std::string proxygen::http2::kProtocolCleartextString |
Referenced by proxygen::DefaultHTTPCodecFactory::getCodec(), proxygen::HTTPDefaultSessionCodecFactory::HTTPDefaultSessionCodecFactory(), proxygen::isValidCodecProtocolStr(), proxygen::HTTPServerAcceptor::makeConfig(), proxygen::HTTP2Codec::requestUpgrade(), TEST(), and HTTPDownstreamTest< C >::testSimpleUpgrade().
const std::string proxygen::http2::kProtocolDraftString |
const std::string proxygen::http2::kProtocolExperimentalString |
const std::string proxygen::http2::kProtocolSettingsHeader |
const std::string proxygen::http2::kProtocolString |