proxygen
proxygen::MockHTTPCodecCallback Class Reference

#include <MockHTTPCodec.h>

Inheritance diagram for proxygen::MockHTTPCodecCallback:
proxygen::HTTPCodec::Callback

Public Member Functions

 MOCK_METHOD2 (onMessageBegin, void(HTTPCodec::StreamID, HTTPMessage *))
 
 MOCK_METHOD3 (onPushMessageBegin, void(HTTPCodec::StreamID, HTTPCodec::StreamID, HTTPMessage *))
 
 MOCK_METHOD4 (onExMessageBegin, void(HTTPCodec::StreamID, HTTPCodec::StreamID, bool, HTTPMessage *))
 
 MOCK_METHOD2 (onHeadersComplete, void(HTTPCodec::StreamID, std::shared_ptr< HTTPMessage >))
 
void onHeadersComplete (HTTPCodec::StreamID stream, std::unique_ptr< HTTPMessage > msg) override
 
 MOCK_METHOD3 (onBody, void(HTTPCodec::StreamID, std::shared_ptr< folly::IOBuf >, uint8_t))
 
void onBody (HTTPCodec::StreamID stream, std::unique_ptr< folly::IOBuf > chain, uint16_t padding) override
 
 MOCK_METHOD2 (onChunkHeader, void(HTTPCodec::StreamID, size_t))
 
 MOCK_METHOD1 (onChunkComplete, void(HTTPCodec::StreamID))
 
 MOCK_METHOD2 (onTrailersComplete, void(HTTPCodec::StreamID, std::shared_ptr< HTTPHeaders >))
 
void onTrailersComplete (HTTPCodec::StreamID stream, std::unique_ptr< HTTPHeaders > trailers) override
 
 MOCK_METHOD2 (onMessageComplete, void(HTTPCodec::StreamID, bool))
 
 MOCK_METHOD3 (onError, void(HTTPCodec::StreamID, std::shared_ptr< HTTPException >, bool))
 
void onError (HTTPCodec::StreamID stream, const HTTPException &exc, bool newStream) override
 
 MOCK_METHOD5 (onFrameHeader, void(uint64_t, uint8_t, uint64_t, uint8_t, uint16_t))
 
 MOCK_METHOD2 (onAbort, void(HTTPCodec::StreamID, ErrorCode))
 
 MOCK_METHOD3 (onGoaway, void(uint64_t, ErrorCode, std::shared_ptr< folly::IOBuf >))
 
void onGoaway (uint64_t lastGoodStreamID, ErrorCode code, std::unique_ptr< folly::IOBuf > debugData) override
 
 MOCK_METHOD1 (onPingRequest, void(uint64_t))
 
 MOCK_METHOD1 (onPingReply, void(uint64_t))
 
 MOCK_METHOD2 (onWindowUpdate, void(HTTPCodec::StreamID, uint32_t))
 
 MOCK_METHOD1 (onSettings, void(const SettingsList &))
 
 MOCK_METHOD0 (onSettingsAck, void())
 
 MOCK_METHOD2 (onPriority, void(HTTPCodec::StreamID, const HTTPMessage::HTTPPriority &))
 
 MOCK_METHOD2 (onCertificateRequest, void(uint16_t, std::shared_ptr< folly::IOBuf >))
 
void onCertificateRequest (uint16_t requestId, std::unique_ptr< folly::IOBuf > certRequestData) override
 
 MOCK_METHOD2 (onCertificate, void(uint16_t, std::shared_ptr< folly::IOBuf >))
 
void onCertificate (uint16_t certId, std::unique_ptr< folly::IOBuf > certData) override
 
 MOCK_METHOD4 (onNativeProtocolUpgrade, bool(HTTPCodec::StreamID, CodecProtocol, const std::string &, HTTPMessage &))
 
 MOCK_METHOD4 (onGenerateFrameHeader, void(HTTPCodec::StreamID, uint8_t, uint64_t, uint16_t))
 
 MOCK_CONST_METHOD0 (numOutgoingStreams, uint32_t())
 
 MOCK_CONST_METHOD0 (numIncomingStreams, uint32_t())
 
- Public Member Functions inherited from proxygen::HTTPCodec::Callback
virtual void onMessageBegin (StreamID stream, HTTPMessage *msg)=0
 
virtual void onPushMessageBegin (StreamID, StreamID, HTTPMessage *)
 
virtual void onExMessageBegin (StreamID, StreamID, bool, HTTPMessage *)
 
virtual void onChunkHeader (StreamID, size_t)
 
virtual void onChunkComplete (StreamID)
 
virtual void onMessageComplete (StreamID stream, bool upgrade)=0
 
virtual void onAbort (StreamID, ErrorCode)
 
virtual void onFrameHeader (StreamID, uint8_t, uint64_t, uint8_t, uint16_t=0)
 
virtual void onPingRequest (uint64_t)
 
virtual void onPingReply (uint64_t)
 
virtual void onWindowUpdate (StreamID, uint32_t)
 
virtual void onSettings (const SettingsList &)
 
virtual void onSettingsAck ()
 
virtual void onPriority (StreamID, const HTTPMessage::HTTPPriority &)
 
virtual bool onNativeProtocolUpgrade (StreamID, CodecProtocol, const std::string &, HTTPMessage &)
 
virtual void onGenerateFrameHeader (StreamID, uint8_t, uint64_t, uint16_t=0)
 
virtual uint32_t numOutgoingStreams () const
 
virtual uint32_t numIncomingStreams () const
 
virtual ~Callback ()
 

Detailed Description

Definition at line 136 of file MockHTTPCodec.h.

Member Function Documentation

proxygen::MockHTTPCodecCallback::MOCK_CONST_METHOD0 ( numOutgoingStreams  ,
uint32_t()   
)
proxygen::MockHTTPCodecCallback::MOCK_CONST_METHOD0 ( numIncomingStreams  ,
uint32_t()   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD0 ( onSettingsAck  ,
void()   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD1 ( onChunkComplete  ,
void(HTTPCodec::StreamID  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD1 ( onPingRequest  ,
void(uint64_t  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD1 ( onPingReply  ,
void(uint64_t  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD1 ( onSettings  ,
void(const SettingsList &)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onMessageBegin  ,
void(HTTPCodec::StreamID, HTTPMessage *)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onHeadersComplete  ,
void(HTTPCodec::StreamID, std::shared_ptr< HTTPMessage >)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onChunkHeader  ,
void(HTTPCodec::StreamID, size_t)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onTrailersComplete  ,
void(HTTPCodec::StreamID, std::shared_ptr< HTTPHeaders >)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onMessageComplete  ,
void(HTTPCodec::StreamID, bool)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onAbort  ,
void(HTTPCodec::StreamID, ErrorCode  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onWindowUpdate  ,
void(HTTPCodec::StreamID, uint32_t  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onPriority  ,
void(HTTPCodec::StreamID, const HTTPMessage::HTTPPriority &)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onCertificateRequest  ,
void(uint16_t, std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD2 ( onCertificate  ,
void(uint16_t, std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD3 ( onPushMessageBegin  ,
void(HTTPCodec::StreamID, HTTPCodec::StreamID, HTTPMessage *)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD3 ( onBody  ,
void(HTTPCodec::StreamID, std::shared_ptr< folly::IOBuf >, uint8_t  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD3 ( onError  ,
void(HTTPCodec::StreamID, std::shared_ptr< HTTPException >, bool)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD3 ( onGoaway  ,
void(uint64_t, ErrorCode, std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD4 ( onExMessageBegin  ,
void(HTTPCodec::StreamID, HTTPCodec::StreamID, bool, HTTPMessage *)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD4 ( onNativeProtocolUpgrade  ,
bool(HTTPCodec::StreamID, CodecProtocol, const std::string &, HTTPMessage &)   
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD4 ( onGenerateFrameHeader  ,
void(HTTPCodec::StreamID, uint8_t, uint64_t, uint16_t  
)
proxygen::MockHTTPCodecCallback::MOCK_METHOD5 ( onFrameHeader  ,
void(uint64_t, uint8_t, uint64_t, uint8_t, uint16_t  
)
void proxygen::MockHTTPCodecCallback::onBody ( HTTPCodec::StreamID  stream,
std::unique_ptr< folly::IOBuf chain,
uint16_t  padding 
)
inlineoverridevirtual

Called for each block of message body data

Parameters
streamThe stream ID
chainOne or more buffers of body data. The codec will remove any protocol framing, such as HTTP/1.1 chunk headers, from the buffers before calling this function.
paddingNumber of pad bytes that came with the data segment

Implements proxygen::HTTPCodec::Callback.

Definition at line 154 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_METHOD1(), and proxygen::MockHTTPCodec::MOCK_METHOD2().

155  {
156  onBody(stream, std::shared_ptr<folly::IOBuf>(chain.release()), padding);
157  }
void onBody(HTTPCodec::StreamID stream, std::unique_ptr< folly::IOBuf > chain, uint16_t padding) override
void proxygen::MockHTTPCodecCallback::onCertificate ( uint16_t  ,
std::unique_ptr< folly::IOBuf  
)
inlineoverridevirtual

Called upon receipt of an authenticator, for protocols that support secondary certificate authentication.

Parameters
certIdThe Cert-ID identifying this authenticator
authenticatorThe authenticator request
Note
Not all protocols support secondary certificate authentication. HTTP/2 does, but HTTP/1.1 doesn't.

Reimplemented from proxygen::HTTPCodec::Callback.

Definition at line 203 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_CONST_METHOD0(), proxygen::MockHTTPCodec::MOCK_METHOD4(), string, uint16_t, uint32_t, uint64_t, and uint8_t.

204  {
205  onCertificate(certId, std::shared_ptr<folly::IOBuf>(certData.release()));
206  }
void onCertificate(uint16_t certId, std::unique_ptr< folly::IOBuf > certData) override
void proxygen::MockHTTPCodecCallback::onCertificateRequest ( uint16_t  ,
std::unique_ptr< folly::IOBuf  
)
inlineoverridevirtual

Called upon receipt of a certificate request frame, for protocols that support secondary certificate authentication.

Parameters
requestIdThe Request-ID identifying the certificate request
authRequestThe authenticator request
Note
Not all protocols support secondary certificate authentication. HTTP/2 does, but HTTP/1.1 doesn't.

Reimplemented from proxygen::HTTPCodec::Callback.

Definition at line 196 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_METHOD2(), and uint16_t.

198  {
200  requestId, std::shared_ptr<folly::IOBuf>(certRequestData.release()));
201  }
void onCertificateRequest(uint16_t requestId, std::unique_ptr< folly::IOBuf > certRequestData) override
void proxygen::MockHTTPCodecCallback::onError ( HTTPCodec::StreamID  stream,
const HTTPException error,
bool  newTxn 
)
inlineoverridevirtual

Called when a parsing or protocol error has occurred

Parameters
streamThe stream ID
errorDescription of the error
newTxntrue if onMessageBegin has not been called for txn

Implements proxygen::HTTPCodec::Callback.

Definition at line 170 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_METHOD2(), proxygen::MockHTTPCodec::MOCK_METHOD3(), proxygen::MockHTTPCodec::MOCK_METHOD5(), uint16_t, uint64_t, and uint8_t.

172  {
173  onError(stream,
174  std::shared_ptr<HTTPException>(new HTTPException(exc)),
175  newStream);
176  }
void onError(HTTPCodec::StreamID stream, const HTTPException &exc, bool newStream) override
void proxygen::MockHTTPCodecCallback::onGoaway ( uint64_t  ,
ErrorCode  ,
std::unique_ptr< folly::IOBuf  
)
inlineoverridevirtual

Called upon receipt of a goaway.

Parameters
lastGoodStreamIDLast successful stream created by the receiver
codeThe code the connection was aborted with
debugDataThe additional debug data for diagnostic purpose
Note
Not all protocols have goaways. SPDY does, but HTTP/1.1 doesn't.

Reimplemented from proxygen::HTTPCodec::Callback.

Definition at line 182 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_METHOD0(), proxygen::MockHTTPCodec::MOCK_METHOD1(), proxygen::MockHTTPCodec::MOCK_METHOD2(), uint16_t, uint32_t, and uint64_t.

183  {
184  onGoaway(lastGoodStreamID, code,
185  std::shared_ptr<folly::IOBuf>(debugData.release()));
186  }
void onGoaway(uint64_t lastGoodStreamID, ErrorCode code, std::unique_ptr< folly::IOBuf > debugData) override
void proxygen::MockHTTPCodecCallback::onHeadersComplete ( HTTPCodec::StreamID  stream,
std::unique_ptr< HTTPMessage msg 
)
inlineoverridevirtual

Called when all the headers of an ingress message have been parsed

Parameters
streamThe stream ID
msgThe message
sizeSize of the ingress header

Implements proxygen::HTTPCodec::Callback.

Definition at line 148 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_METHOD3(), and uint8_t.

149  {
150  onHeadersComplete(stream, std::shared_ptr<HTTPMessage>(msg.release()));
151  }
void onHeadersComplete(HTTPCodec::StreamID stream, std::unique_ptr< HTTPMessage > msg) override
void proxygen::MockHTTPCodecCallback::onTrailersComplete ( HTTPCodec::StreamID  stream,
std::unique_ptr< HTTPHeaders trailers 
)
inlineoverridevirtual

Called when all the trailers of an ingress message have been parsed, but only if the number of trailers is nonzero.

Parameters
streamThe stream ID
trailersThe message trailers

Implements proxygen::HTTPCodec::Callback.

Definition at line 162 of file MockHTTPCodec.h.

References proxygen::MockHTTPCodec::MOCK_METHOD2(), and proxygen::MockHTTPCodec::MOCK_METHOD3().

163  {
165  std::shared_ptr<HTTPHeaders>(trailers.release()));
166  }
void onTrailersComplete(HTTPCodec::StreamID stream, std::unique_ptr< HTTPHeaders > trailers) override

The documentation for this class was generated from the following file: