proxygen
proxygen::HTTPTransactionIngressSMData Class Reference

#include <HTTPTransactionIngressSM.h>

Public Types

enum  State : uint8_t {
  State::Start, State::HeadersReceived, State::RegularBodyReceived, State::ChunkHeaderReceived,
  State::ChunkBodyReceived, State::ChunkCompleted, State::TrailersReceived, State::UpgradeComplete,
  State::EOMQueued, State::ReceivingDone
}
 
enum  Event : uint8_t {
  Event::onHeaders, Event::onBody, Event::onChunkHeader, Event::onChunkComplete,
  Event::onTrailers, Event::onUpgrade, Event::onEOM, Event::eomFlushed
}
 

Static Public Member Functions

static State getInitialState ()
 
static std::pair< State, bool > find (State s, Event e)
 
static const std::string getName ()
 

Detailed Description

Definition at line 18 of file HTTPTransactionIngressSM.h.

Member Enumeration Documentation

Enumerator
onHeaders 
onBody 
onChunkHeader 
onChunkComplete 
onTrailers 
onUpgrade 
onEOM 
eomFlushed 

Definition at line 34 of file HTTPTransactionIngressSM.h.

34  : uint8_t {
35  // API accessible transitions
36  onHeaders,
37  onBody,
38  onChunkHeader,
39  onChunkComplete,
40  onTrailers,
41  onUpgrade,
42  onEOM,
43  // Internal state transitions
44  eomFlushed,
45  };
Enumerator
Start 
HeadersReceived 
RegularBodyReceived 
ChunkHeaderReceived 
ChunkBodyReceived 
ChunkCompleted 
TrailersReceived 
UpgradeComplete 
EOMQueued 
ReceivingDone 

Definition at line 21 of file HTTPTransactionIngressSM.h.

21  : uint8_t {
22  Start,
23  HeadersReceived,
24  RegularBodyReceived,
25  ChunkHeaderReceived,
26  ChunkBodyReceived,
27  ChunkCompleted,
28  TrailersReceived,
29  UpgradeComplete,
30  EOMQueued,
31  ReceivingDone,
32  };

Member Function Documentation

std::pair< HTTPTransactionIngressSMData::State, bool > proxygen::HTTPTransactionIngressSMData::find ( HTTPTransactionIngressSMData::State  s,
HTTPTransactionIngressSMData::Event  e 
)
static

Definition at line 28 of file HTTPTransactionIngressSM.cpp.

References ChunkBodyReceived, ChunkCompleted, ChunkHeaderReceived, eomFlushed, EOMQueued, HeadersReceived, onBody, onChunkComplete, onChunkHeader, onEOM, onHeaders, onTrailers, onUpgrade, ReceivingDone, RegularBodyReceived, Start, TrailersReceived, and UpgradeComplete.

Referenced by getInitialState().

29  {
32  using TransitionTable = std::map<std::pair<State, Event>, State>;
33 
34  static const folly::Indestructible<TransitionTable> transitions{
35  TransitionTable{
37 
38  // For HTTP receiving 100 response, then a regular response
39  {{State::HeadersReceived, Event::onHeaders}, State::HeadersReceived},
40 
44  // special case - 0 byte body with trailers
48 
49  {{State::RegularBodyReceived, Event::onBody}, State::RegularBodyReceived},
50  // HTTP2 supports trailers and doesn't handle body as chunked events
51  {{State::RegularBodyReceived, Event::onTrailers}, State::TrailersReceived},
52  {{State::RegularBodyReceived, Event::onEOM}, State::EOMQueued},
53 
55 
56  {{State::ChunkBodyReceived, Event::onBody}, State::ChunkBodyReceived},
58 
59  {{State::ChunkCompleted, Event::onChunkHeader}, State::ChunkHeaderReceived},
60  // TODO: "trailers" may be received at any time due to the SPDY HEADERS
61  // frame coming at any time. We might want to have a
62  // TransactionStateMachineFactory that takes a codec and generates the
63  // appropriate transaction state machine from that.
64  {{State::ChunkCompleted, Event::onTrailers}, State::TrailersReceived},
65  {{State::ChunkCompleted, Event::onEOM}, State::EOMQueued},
66 
67  {{State::TrailersReceived, Event::onEOM}, State::EOMQueued},
68 
69  {{State::UpgradeComplete, Event::onBody}, State::UpgradeComplete},
70  {{State::UpgradeComplete, Event::onEOM}, State::EOMQueued},
71 
73  }
74  };
75 
76  auto const &it = transitions->find(std::make_pair(s, e));
77  if (it == transitions->end()) {
78  return std::make_pair(s, false);
79  }
80 
81  return std::make_pair(it->second, true);
82 }
static set< string > s
static State proxygen::HTTPTransactionIngressSMData::getInitialState ( )
inlinestatic

Definition at line 47 of file HTTPTransactionIngressSM.h.

References find(), s, and Start.

static const std::string proxygen::HTTPTransactionIngressSMData::getName ( )
inlinestatic

Definition at line 53 of file HTTPTransactionIngressSM.h.

References proxygen::operator<<(), and s.

53  {
54  return "HTTPTransactionIngress";
55  }

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