proxygen
fizz::client::ClientStateMachine Class Reference

#include <ClientProtocol.h>

Inheritance diagram for fizz::client::ClientStateMachine:
fizz::client::test::MockClientStateMachine fizz::client::test::MockClientStateMachineInstance fizz::client::test::MockClientStateMachineInstance

Public Types

using StateType = State
 
using ProcessingActions = Actions
 
using CompletedActions = Actions
 

Public Member Functions

virtual ~ClientStateMachine ()=default
 
virtual Actions processConnect (const State &, std::shared_ptr< const FizzClientContext > context, std::shared_ptr< const CertificateVerifier > verifier, folly::Optional< std::string > sni, folly::Optional< CachedPsk > cachedPsk, const std::shared_ptr< ClientExtensions > &extensions)
 
virtual Actions processSocketData (const State &, folly::IOBufQueue &)
 
virtual Actions processWriteNewSessionTicket (const State &, WriteNewSessionTicket)
 
virtual Actions processAppWrite (const State &, AppWrite)
 
virtual Actions processEarlyAppWrite (const State &, EarlyAppWrite)
 
virtual Actions processAppClose (const State &)
 

Detailed Description

Definition at line 20 of file ClientProtocol.h.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual fizz::client::ClientStateMachine::~ClientStateMachine ( )
virtualdefault

Member Function Documentation

Actions fizz::client::ClientStateMachine::processAppClose ( const State state)
virtual

Definition at line 201 of file ClientProtocol.cpp.

References fizz::client::detail::handleAppClose().

201  {
202  return detail::handleAppClose(state);
203 }
Actions handleAppClose(const State &state)
Actions fizz::client::ClientStateMachine::processAppWrite ( const State state,
AppWrite  write 
)
virtual

Definition at line 189 of file ClientProtocol.cpp.

References folly::gen::move, and fizz::client::detail::processEvent().

Referenced by fizz::client::test::TEST_F().

191  {
192  return detail::processEvent(state, std::move(write));
193 }
void write(const T &in, folly::io::Appender &appender)
Definition: Types-inl.h:112
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Actions processEvent(const State &state, Param param)
Actions fizz::client::ClientStateMachine::processConnect ( const State state,
std::shared_ptr< const FizzClientContext context,
std::shared_ptr< const CertificateVerifier verifier,
folly::Optional< std::string sni,
folly::Optional< CachedPsk cachedPsk,
const std::shared_ptr< ClientExtensions > &  extensions 
)
virtual

Definition at line 144 of file ClientProtocol.cpp.

References fizz::Connect::cachedPsk, folly::netops::connect(), fizz::Connect::context, fizz::Connect::extensions, folly::gen::move, fizz::client::detail::processEvent(), fizz::Connect::sni, and fizz::Connect::verifier.

150  {
152  connect.context = std::move(context);
153  connect.sni = std::move(sni);
154  connect.verifier = std::move(verifier);
155  connect.extensions = extensions;
156  connect.cachedPsk = std::move(cachedPsk);
157  return detail::processEvent(state, std::move(connect));
158 }
int connect(NetworkSocket s, const sockaddr *name, socklen_t namelen)
Definition: NetOps.cpp:94
context
Definition: CMakeCache.txt:563
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Actions processEvent(const State &state, Param param)
Actions fizz::client::ClientStateMachine::processEarlyAppWrite ( const State state,
EarlyAppWrite  write 
)
virtual

Definition at line 195 of file ClientProtocol.cpp.

References folly::gen::move, and fizz::client::detail::processEvent().

197  {
198  return detail::processEvent(state, std::move(write));
199 }
void write(const T &in, folly::io::Appender &appender)
Definition: Types-inl.h:112
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Actions processEvent(const State &state, Param param)
Actions fizz::client::ClientStateMachine::processSocketData ( const State state,
folly::IOBufQueue buf 
)
virtual

Definition at line 160 of file ClientProtocol.cpp.

References fizz::client::detail::actions(), fizz::decode_error, fizz::client::detail::handleError(), folly::gen::move, folly::none, fizz::client::detail::processEvent(), fizz::ReadRecordLayer::readEvent(), and fizz::client::State::readRecordLayer().

162  {
163  try {
164  if (!state.readRecordLayer()) {
165  return detail::handleError(
166  state,
167  ReportError("attempting to process data without record layer"),
168  folly::none);
169  }
170  auto param = state.readRecordLayer()->readEvent(buf);
171  if (!param.hasValue()) {
172  return actions(WaitForData());
173  }
174  return detail::processEvent(state, std::move(*param));
175  } catch (const std::exception& e) {
176  return detail::handleError(
177  state,
178  ReportError(folly::exception_wrapper(std::current_exception(), e)),
180  }
181 }
Actions handleError(const State &state, ReportError error, Optional< AlertDescription > alertDesc)
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
ReadRecordLayer * readRecordLayer() const
Definition: State.h:235
virtual folly::Optional< Param > readEvent(folly::IOBufQueue &socketBuf)
Definition: RecordLayer.cpp:18
Actions actions(Args &&...act)
Definition: Actions.h:86
Actions processEvent(const State &state, Param param)
constexpr None none
Definition: Optional.h:87
Actions fizz::client::ClientStateMachine::processWriteNewSessionTicket ( const State state,
WriteNewSessionTicket  write 
)
virtual

Definition at line 183 of file ClientProtocol.cpp.

References folly::gen::move, and fizz::client::detail::processEvent().

Referenced by fizz::client::test::TEST_F().

185  {
186  return detail::processEvent(state, std::move(write));
187 }
void write(const T &in, folly::io::Appender &appender)
Definition: Types-inl.h:112
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Actions processEvent(const State &state, Param param)

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