24 bool forceUpstream1_1 =
false);
41 bool isBusy()
const override;
59 std::unique_ptr<folly::IOBuf> chain,
64 size_t length)
override;
79 std::unique_ptr<folly::IOBuf> debugData =
nullptr)
override;
143 int onURL(
const char* buf,
size_t len);
144 int onReason(
const char* buf,
size_t len);
148 int onBody(
const char* buf,
size_t len);
158 std::unique_ptr<HTTPMessage>
msg_;
208 const char* buf,
size_t len);
std::pair< CodecProtocol, std::string > upgradeResult_
size_t generateTrailers(folly::IOBufQueue &writeBuf, StreamID txn, const HTTPHeaders &trailers) override
int onBody(const char *buf, size_t len)
std::string currentHeaderValue_
TransportDirection transportDirection_
spdy::GoawayStatusCode statusCode
std::unique_ptr< HTTPMessage > msg_
void serializeWebsocketHeader(folly::IOBufQueue &writeBuf, size_t &len, bool upstream)
bool isBusy() const override
const std::string & getAllowedUpgradeProtocols()
std::unique_ptr< HTTPMessage > upgradeRequest_
void setAllowedUpgradeProtocols(std::list< std::string > protocols)
HeaderParseState headerParseState_
CodecProtocol getProtocol() const override
void generateHeader(folly::IOBufQueue &writeBuf, StreamID txn, const HTTPMessage &msg, bool eom=false, HTTPHeaderSize *size=nullptr) override
bool supportsParallelRequests() const override
std::string upgradeHeader_
static int onChunkHeaderCB(http_parser *parser)
static int onQueryStringCB(http_parser *parser, const char *buf, size_t len)
static bool supportsNextProtocol(const std::string &npn)
bool disableKeepalivePending_
folly::StringPiece currentHeaderNameStringPiece_
bool closeOnEgressComplete() const override
int onHeaderValue(const char *buf, size_t len)
bool expectNoResponseBody_
static int onMessageCompleteCB(http_parser *parser)
static int onHeaderValueCB(http_parser *parser, const char *buf, size_t len)
std::string generateWebsocketKey() const
static int onMessageBeginCB(http_parser *parser)
static http_parser * parser
static int onHeadersCompleteCB(http_parser *parser, const char *buf, size_t len)
const std::string & getUserAgent() const override
std::string currentHeaderName_
static int onChunkCompleteCB(http_parser *parser)
static int onUrlCB(http_parser *parser, const char *buf, size_t len)
HTTPCodec::Callback * callback_
constexpr auto size(C const &c) -> decltype(c.size())
TransportDirection getTransportDirection() const override
void writeBuf(const Buf &buf, folly::io::Appender &out)
HTTPHeaderSize headerSize_
void setCallback(Callback *callback) override
void addDateHeader(folly::IOBufQueue &writeBuf, size_t &len)
bool isReusable() const override
size_t onIngress(const folly::IOBuf &buf) override
static int onReasonCB(http_parser *parser, const char *buf, size_t len)
static int onBodyCB(http_parser *parser, const char *buf, size_t len)
bool isParsingHeaderOrTrailerName() const
bool isParsingHeaders() const
int onHeaderField(const char *buf, size_t len)
int onHeadersComplete(size_t len)
void onParserError(const char *what=nullptr)
std::string allowedNativeUpgrades_
void setParserPaused(bool paused) override
std::string websockAcceptKey_
int onReason(const char *buf, size_t len)
void pushHeaderNameAndValue(HTTPHeaders &hdrs)
size_t generateRstStream(folly::IOBufQueue &writeBuf, StreamID txn, ErrorCode statusCode) override
KeepaliveRequested keepaliveRequested_
static int onHeaderFieldCB(http_parser *parser, const char *buf, size_t len)
bool isWaitingToDrain() const override
std::string generateWebsocketAccept(const std::string &acceptKey) const
bool ingressUpgradeComplete_
StreamID createStream() override
bool supportsPushTransactions() const override
size_t generateEOM(folly::IOBufQueue &writeBuf, StreamID txn) override
int onURL(const char *buf, size_t len)
std::unique_ptr< HTTPHeaders > trailers_
static int onPathCB(http_parser *parser, const char *buf, size_t len)
const folly::IOBuf * currentIngressBuf_
size_t generateGoaway(folly::IOBufQueue &writeBuf, StreamID lastStream, ErrorCode statusCode, std::unique_ptr< folly::IOBuf > debugData=nullptr) override
int onChunkHeader(size_t len)
HTTP1xCodec(TransportDirection direction, bool forceUpstream1_1=false)
void onIngressEOF() override
static const http_parser_settings * getParserSettings()
size_t generateChunkHeader(folly::IOBufQueue &writeBuf, StreamID txn, size_t length) override
size_t generateBody(folly::IOBufQueue &writeBuf, StreamID txn, std::unique_ptr< folly::IOBuf > chain, folly::Optional< uint8_t > padding, bool eom) override
size_t generateChunkTerminator(folly::IOBufQueue &writeBuf, StreamID txn) override