proxygen
FizzServer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
11 #include <fizz/protocol/FizzBase.h>
14 
15 namespace fizz {
16 namespace server {
17 
18 bool looksLikeV2ClientHello(const folly::IOBufQueue& queue);
19 
20 template <typename ActionMoveVisitor, typename SM = ServerStateMachine>
21 class FizzServer : public FizzBase<
22  FizzServer<ActionMoveVisitor, SM>,
23  ActionMoveVisitor,
24  SM> {
25  public:
26  using FizzBase<FizzServer<ActionMoveVisitor, SM>, ActionMoveVisitor, SM>::
27  FizzBase;
28 
29  void accept(
31  std::shared_ptr<const FizzServerContext> context,
32  std::shared_ptr<ServerExtensions> extensions = nullptr);
33 
34  void newTransportData();
35 
40  Buf getEarlyEkm(folly::StringPiece label, const Buf& context, uint16_t length)
41  const;
42 
43  private:
44  friend class FizzBase<
45  FizzServer<ActionMoveVisitor, SM>,
46  ActionMoveVisitor,
47  SM>;
48 
50 
51  bool checkV2Hello_{false};
52 };
53 } // namespace server
54 } // namespace fizz
55 
FizzBase(const typename StateMachine::StateType &state, folly::IOBufQueue &transportReadBuf, ActionMoveVisitor &visitor, folly::DelayedDestructionBase *owner)
Definition: FizzBase.h:28
context
Definition: CMakeCache.txt:563
boost::variant< Actions, folly::Future< Actions >> AsyncActions
Definition: Actions.h:52
void startActions(AsyncActions actions)
bool looksLikeV2ClientHello(const folly::IOBufQueue &queue)
Definition: FizzServer.cpp:14
void accept(folly::Executor *executor, std::shared_ptr< const FizzServerContext > context, std::shared_ptr< ServerExtensions > extensions=nullptr)
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
Definition: Actions.h:16
Actions actions(Args &&...act)
Definition: Actions.h:86
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22
Buf getEarlyEkm(folly::StringPiece label, const Buf &context, uint16_t length) const
StringPiece label