proxygen
FizzServer.cpp
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 
10 
11 namespace fizz {
12 namespace server {
13 
15  if (queue.empty()) {
16  return false;
17  }
18  folly::io::Cursor cursor(queue.front());
19  if (!cursor.canAdvance(3)) {
20  return false;
21  }
22  uint8_t byte1 = cursor.read<uint8_t>();
23  cursor.skip(1);
24  uint8_t byte3 = cursor.read<uint8_t>();
25  if (byte1 & 0x80 && byte3 == 0x01) {
26  return true;
27  }
28  return false;
29 }
30 } // namespace server
31 } // namespace fizz
const folly::IOBuf * front() const
Definition: IOBufQueue.h:476
bool empty() const
Definition: IOBufQueue.h:503
bool looksLikeV2ClientHello(const folly::IOBufQueue &queue)
Definition: FizzServer.cpp:14
Definition: Actions.h:16