proxygen
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 
14 
15 namespace proxygen {
16 
17 class HTTPMessage;
18 
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;
28  regularHeaderSeen_ = false;
29  pseudoHeaderSeen_ = false;
30  parsingError = "";
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;
47 
48  private:
49  bool isRequest_{false};
50  bool isRequestTrailers_{false};
51  bool hasStatus_{false};
52  bool regularHeaderSeen_{false};
53  bool pseudoHeaderSeen_{false};
55 };
56 
57 }
std::unique_ptr< HTTPMessage > msg
void reset(HTTPMessage *msg)
HPACK::DecodeError decodeError
folly::Optional< uint32_t > contentLength_
const char * name
Definition: http_parser.c:437
bool onHeader(const folly::fbstring &name, const folly::fbstring &value)
static const char *const value
Definition: Conv.cpp:50
const char * string
Definition: Conv.cpp:212
void init(bool isRequestIn, bool isRequestTrailers)
void onHeadersComplete(HTTPHeaderSize decodedSize)
constexpr None none
Definition: Optional.h:87
HTTPRequestVerifier verifier