proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HTTPCodecFactory.cpp
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
#include <
proxygen/lib/http/codec/HTTPCodecFactory.h
>
11
#include <
proxygen/lib/http/codec/HTTP1xCodec.h
>
12
#include <
proxygen/lib/http/codec/SPDYCodec.h
>
13
#include <
proxygen/lib/http/codec/HTTP2Codec.h
>
14
15
namespace
proxygen
{
16
17
std::unique_ptr<HTTPCodec>
HTTPCodecFactory::getCodec
(
18
CodecProtocol
protocol,
TransportDirection
direction) {
19
switch
(protocol) {
20
case
CodecProtocol::HTTP_1_1
:
21
return
std::make_unique<HTTP1xCodec>(direction);
22
case
CodecProtocol::SPDY_3
:
23
return
std::make_unique<SPDYCodec>(direction,
SPDYVersion::SPDY3
);
24
case
CodecProtocol::SPDY_3_1
:
25
return
std::make_unique<SPDYCodec>(direction,
SPDYVersion::SPDY3_1
);
26
case
CodecProtocol::HTTP_2
:
27
return
std::make_unique<HTTP2Codec>(direction);
28
default
:
29
LOG(FATAL) <<
"Unreachable"
;
30
return
nullptr
;
31
}
32
}
33
34
}
HTTP1xCodec.h
HTTPCodecFactory.h
proxygen::HTTPCodecFactory::getCodec
virtual std::unique_ptr< HTTPCodec > getCodec(const std::string &protocolHint, TransportDirection direction, bool isTLS)=0
SPDYCodec.h
proxygen::SPDYVersion::SPDY3
proxygen::CodecProtocol::HTTP_2
HTTP2Codec.h
proxygen::CodecProtocol::SPDY_3_1
proxygen::CodecProtocol::HTTP_1_1
proxygen::TransportDirection
TransportDirection
Definition:
TransportDirection.h:17
proxygen
Definition:
ExMessageHandler.h:14
proxygen::CodecProtocol::SPDY_3
proxygen::SPDYVersion::SPDY3_1
proxygen::CodecProtocol
CodecProtocol
Definition:
CodecProtocol.h:19
proxygen
lib
http
codec
HTTPCodecFactory.cpp
Generated by
1.8.11