proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HeaderDecodeInfo.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. 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 <
proxygen/lib/http/codec/compress/HPACKConstants.h
>
13
#include <
proxygen/lib/http/codec/HTTPRequestVerifier.h
>
14
15
namespace
proxygen
{
16
17
class
HTTPMessage;
18
19
class
HeaderDecodeInfo
{
20
public
:
21
void
init
(
bool
isRequestIn,
bool
isRequestTrailers) {
22
CHECK(!
msg
);
23
msg
.reset(
new
HTTPMessage
());
24
isRequest_
= isRequestIn;
25
isRequestTrailers_
= isRequestTrailers;
26
hasStatus_
=
false
;
27
contentLength_
=
folly::none
;
28
regularHeaderSeen_
=
false
;
29
pseudoHeaderSeen_
=
false
;
30
parsingError
=
""
;
31
decodeError
=
HPACK::DecodeError::NONE
;
32
verifier
.
reset
(
msg
.get());
33
}
34
35
bool
onHeader
(
const
folly::fbstring
&
name
,
const
folly::fbstring
&
value
);
36
37
void
onHeadersComplete
(
HTTPHeaderSize
decodedSize);
38
39
bool
hasStatus
()
const
;
40
41
// Change this to a map of decoded header blocks when we decide
42
// to concurrently decode partial header blocks
43
std::unique_ptr<HTTPMessage>
msg
;
44
HTTPRequestVerifier
verifier
;
45
std::string
parsingError
;
46
HPACK::DecodeError
decodeError
{
HPACK::DecodeError::NONE
};
47
48
private
:
49
bool
isRequest_
{
false
};
50
bool
isRequestTrailers_
{
false
};
51
bool
hasStatus_
{
false
};
52
bool
regularHeaderSeen_
{
false
};
53
bool
pseudoHeaderSeen_
{
false
};
54
folly::Optional<uint32_t>
contentLength_
;
55
};
56
57
}
HTTPRequestVerifier.h
proxygen::HeaderDecodeInfo::regularHeaderSeen_
bool regularHeaderSeen_
Definition:
HeaderDecodeInfo.h:52
proxygen::HeaderDecodeInfo::isRequest_
bool isRequest_
Definition:
HeaderDecodeInfo.h:49
proxygen::HeaderDecodeInfo::parsingError
std::string parsingError
Definition:
HeaderDecodeInfo.h:45
proxygen::HeaderDecodeInfo::msg
std::unique_ptr< HTTPMessage > msg
Definition:
HeaderDecodeInfo.h:43
proxygen::HPACK::DecodeError::NONE
folly::basic_fbstring< char >
proxygen::HTTPRequestVerifier::reset
void reset(HTTPMessage *msg)
Definition:
HTTPRequestVerifier.h:22
proxygen::HeaderDecodeInfo::decodeError
HPACK::DecodeError decodeError
Definition:
HeaderDecodeInfo.h:46
proxygen::HeaderDecodeInfo::contentLength_
folly::Optional< uint32_t > contentLength_
Definition:
HeaderDecodeInfo.h:54
proxygen::HeaderDecodeInfo::pseudoHeaderSeen_
bool pseudoHeaderSeen_
Definition:
HeaderDecodeInfo.h:53
name
const char * name
Definition:
http_parser.c:437
proxygen::HeaderDecodeInfo
Definition:
HeaderDecodeInfo.h:19
proxygen::HeaderDecodeInfo::onHeader
bool onHeader(const folly::fbstring &name, const folly::fbstring &value)
Definition:
HeaderDecodeInfo.cpp:16
folly::Optional< uint32_t >
proxygen::HTTPRequestVerifier
Definition:
HTTPRequestVerifier.h:18
HPACKConstants.h
value
static const char *const value
Definition:
Conv.cpp:50
proxygen::HeaderDecodeInfo::hasStatus
bool hasStatus() const
Definition:
HeaderDecodeInfo.cpp:135
proxygen::HeaderDecodeInfo::isRequestTrailers_
bool isRequestTrailers_
Definition:
HeaderDecodeInfo.h:50
wangle::HTTPHeaderSize
Definition:
TransportInfo.h:38
proxygen::HPACK::DecodeError
DecodeError
Definition:
HPACKConstants.h:81
string
const char * string
Definition:
Conv.cpp:212
proxygen
Definition:
ExMessageHandler.h:14
proxygen::HTTPMessage
Definition:
HTTPMessage.h:39
proxygen::HeaderDecodeInfo::init
void init(bool isRequestIn, bool isRequestTrailers)
Definition:
HeaderDecodeInfo.h:21
proxygen::HeaderDecodeInfo::hasStatus_
bool hasStatus_
Definition:
HeaderDecodeInfo.h:51
proxygen::HeaderDecodeInfo::onHeadersComplete
void onHeadersComplete(HTTPHeaderSize decodedSize)
Definition:
HeaderDecodeInfo.cpp:111
folly::none
constexpr None none
Definition:
Optional.h:87
proxygen::HeaderDecodeInfo::verifier
HTTPRequestVerifier verifier
Definition:
HeaderDecodeInfo.h:44
proxygen
lib
http
codec
HeaderDecodeInfo.h
Generated by
1.8.11