proxygen
CodecProtocol.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-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. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <cstdint>
13 #include <folly/Optional.h>
15 #include <string>
16 
17 namespace proxygen {
18 
19 enum class CodecProtocol : uint8_t {
20  HTTP_1_1,
21  SPDY_3,
22  SPDY_3_1,
23  HTTP_2,
24  HQ,
25 };
26 
31 
35 extern bool isValidCodecProtocolStr(const std::string& protocolStr);
36 
41 extern CodecProtocol getCodecProtocolFromStr(const std::string& protocolStr);
42 
46 FB_EXPORT extern bool isSpdyCodecProtocol(CodecProtocol protocol);
47 
51 extern bool isHTTP2CodecProtocol(CodecProtocol protocol);
52 
56 extern bool isHQCodecProtocol(CodecProtocol protocol);
57 
61 extern bool isParallelCodecProtocol(CodecProtocol protocol);
62 
68 checkForProtocolUpgrade(const std::string& clientUpgrade,
69  const std::string& serverUpgrade,
70  bool serverMode);
71 
72 }
#define FB_EXPORT
Definition: Export.h:26
bool isHQCodecProtocol(CodecProtocol protocol)
folly::Optional< std::pair< CodecProtocol, std::string > > checkForProtocolUpgrade(const std::string &clientUpgrade, const std::string &serverUpgrade, bool serverMode)
const std::string & getCodecProtocolString(CodecProtocol proto)
bool isSpdyCodecProtocol(CodecProtocol protocol)
bool isParallelCodecProtocol(CodecProtocol protocol)
const char * string
Definition: Conv.cpp:212
bool isHTTP2CodecProtocol(CodecProtocol protocol)
CodecProtocol getCodecProtocolFromStr(const std::string &protocolStr)
bool isValidCodecProtocolStr(const std::string &protocolStr)