proxygen
|
#include <FizzBase.h>
Public Member Functions | |
FizzBase (const typename StateMachine::StateType &state, folly::IOBufQueue &transportReadBuf, ActionMoveVisitor &visitor, folly::DelayedDestructionBase *owner) | |
void | writeNewSessionTicket (WriteNewSessionTicket writeNewSessionTicket) |
void | appWrite (AppWrite appWrite) |
void | earlyAppWrite (EarlyAppWrite appWrite) |
void | appClose () |
void | waitForData () |
void | newTransportData () |
void | moveToErrorState (const folly::AsyncSocketException &ex) |
bool | inErrorState () const |
bool | actionProcessing () const |
Buf | getEkm (folly::StringPiece label, const Buf &context, uint16_t length) const |
Protected Member Functions | |
void | processActions (typename StateMachine::CompletedActions actions) |
void | addProcessingActions (typename StateMachine::ProcessingActions actions) |
Protected Attributes | |
StateMachine | machine_ |
const StateMachine::StateType & | state_ |
folly::IOBufQueue & | transportReadBuf_ |
Private Types | |
using | PendingEvent = boost::variant< AppWrite, EarlyAppWrite, AppClose, WriteNewSessionTicket > |
Private Member Functions | |
void | processPendingEvents () |
Private Attributes | |
ActionMoveVisitor & | visitor_ |
folly::DelayedDestructionBase * | owner_ |
std::deque< PendingEvent > | pendingEvents_ |
bool | waitForData_ {true} |
folly::Optional< folly::DelayedDestruction::DestructorGuard > | actionGuard_ |
bool | inProcessPendingEvents_ {false} |
bool | inErrorState_ {false} |
FizzBase defines an async method of communicating with the fizz state machine. Given a const reference to state, and a reference to transportReadBuf, FizzBase will consume the transportReadBuf and process events as applicable. visitor is variant visitor that is expected to process Actions as they are received. A DestructorGuard on owner will be taken when async actions are in flight, during which time this class must not be deleted.
Definition at line 26 of file FizzBase.h.
|
private |
Definition at line 112 of file FizzBase.h.
|
inline |
Definition at line 28 of file FizzBase.h.
bool fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::actionProcessing | ( | ) | const |
Returns true if the state machine is actively processing an event or action.
Definition at line 81 of file FizzBase-inl.h.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
|
protected |
Definition at line 102 of file FizzBase-inl.h.
References folly::gen::move, and fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::processPendingEvents().
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::appClose | ( | ) |
Called when the application wants to close the connection.
Definition at line 34 of file FizzBase-inl.h.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::appWrite | ( | AppWrite | appWrite | ) |
Called to write application data.
Definition at line 21 of file FizzBase-inl.h.
References folly::gen::move.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::earlyAppWrite | ( | EarlyAppWrite | appWrite | ) |
Called to write early application data.
Definition at line 27 of file FizzBase-inl.h.
References folly::gen::move.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
Buf fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::getEkm | ( | folly::StringPiece | label, |
const Buf & | context, | ||
uint16_t | length | ||
) | const |
Returns an exported key material derived from the 1-RTT secret of the TLS connection.
Definition at line 159 of file FizzBase-inl.h.
References fizz::Exporter::getEkm(), and fizz::test::label.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
bool fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::inErrorState | ( | ) | const |
Returns true if in error state where no further events will be processed.
Definition at line 76 of file FizzBase-inl.h.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::moveToErrorState | ( | const folly::AsyncSocketException & | ex | ) |
Calls error callbacks on any pending events and prevents any further events from being processed. Should be called when an error is received from either the state machine or the transport that will cause the connection to abort. Note that this does not stop a currently processing event.
Definition at line 51 of file FizzBase-inl.h.
References fizz::AppWrite::callback, folly::gen::move, folly::variant_match(), fizz::detail::write(), and folly::AsyncWriter::WriteCallback::writeErr().
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::newTransportData | ( | ) |
Called to notify that new transport data is available in transportReadBuf.
Definition at line 45 of file FizzBase-inl.h.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
|
protected |
Definition at line 87 of file FizzBase-inl.h.
References upload::action, and folly::apply_visitor().
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase(), and fizz::server::FizzServer< ActionMoveVisitor, SM >::startActions().
|
private |
Definition at line 115 of file FizzBase-inl.h.
References fizz::client::detail::actions(), folly::gen::move, SCOPE_EXIT, folly::variant_match(), and fizz::detail::write().
Referenced by fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::addProcessingActions().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::waitForData | ( | ) |
Called to pause processing of transportReadBuf until new data is available.
Call newTransportData() to resume processing.
Definition at line 40 of file FizzBase-inl.h.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
void fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::writeNewSessionTicket | ( | WriteNewSessionTicket | writeNewSessionTicket | ) |
Server only: Called to write new session ticket to client.
Definition at line 14 of file FizzBase-inl.h.
References folly::gen::move.
Referenced by fizz::FizzBase< FizzServer< ActionMoveVisitor, SM >, ActionMoveVisitor, SM >::FizzBase().
|
private |
Definition at line 115 of file FizzBase.h.
|
private |
Definition at line 117 of file FizzBase.h.
|
private |
Definition at line 116 of file FizzBase.h.
|
protected |
Definition at line 101 of file FizzBase.h.
|
private |
Definition at line 109 of file FizzBase.h.
|
private |
Definition at line 113 of file FizzBase.h.
|
protected |
Definition at line 102 of file FizzBase.h.
|
protected |
Definition at line 103 of file FizzBase.h.
|
private |
Definition at line 108 of file FizzBase.h.
|
private |
Definition at line 114 of file FizzBase.h.