proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
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
9
#include <
fizz/server/FizzServer.h
>
10
11
namespace
fizz
{
12
namespace
server {
13
14
bool
looksLikeV2ClientHello
(
const
folly::IOBufQueue
& queue) {
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
folly::IOBufQueue::front
const folly::IOBuf * front() const
Definition:
IOBufQueue.h:476
folly::IOBufQueue::empty
bool empty() const
Definition:
IOBufQueue.h:503
fizz::server::looksLikeV2ClientHello
bool looksLikeV2ClientHello(const folly::IOBufQueue &queue)
Definition:
FizzServer.cpp:14
folly::io::Cursor
Definition:
Cursor.h:721
FizzServer.h
uint8_t
uint8_t
Definition:
ConstexprMathBenchmark.cpp:178
folly::IOBufQueue
Definition:
IOBufQueue.h:35
fizz
Definition:
Actions.h:16
proxygen
fizz
fizz
server
FizzServer.cpp
Generated by
1.8.11