proxygen
HTTPDirectResponseHandler.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 
13 
14 namespace proxygen {
15 
16 class HTTPErrorPage;
17 
20 public:
21  HTTPDirectResponseHandler(unsigned statusCode, const std::string& statusMsg,
22  const HTTPErrorPage* errorPage = nullptr);
23 
26  }
27  // HTTPTransaction::Handler methods
28  void setTransaction(HTTPTransaction* txn) noexcept override;
29  void detachTransaction() noexcept override;
30  void onHeadersComplete(std::unique_ptr<HTTPMessage> msg) noexcept override;
31  void onBody(std::unique_ptr<folly::IOBuf> chain) noexcept override;
32  void onTrailers(std::unique_ptr<HTTPHeaders> trailers) noexcept override;
33  void onEOM() noexcept override;
34  void onUpgrade(UpgradeProtocol protocol) noexcept override;
35  void onError(const HTTPException& error) noexcept override;
36  // These are no-ops since the direct response is already in memory
37  void onEgressPaused() noexcept override {};
38  void onEgressResumed() noexcept override {};
39 
40 private:
41  ~HTTPDirectResponseHandler() override;
42 
46  unsigned statusCode_;
47  bool headersSent_:1;
48  bool eomSent_:1;
50 };
51 
52 } // proxygen
spdy::GoawayStatusCode statusCode
Definition: SPDYCodec.cpp:110
requires E e noexcept(noexcept(s.error(std::move(e))))
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
HTTPDirectResponseHandler(unsigned statusCode, const std::string &statusMsg, const HTTPErrorPage *errorPage=nullptr)
void onBody(std::unique_ptr< folly::IOBuf > chain) noexceptoverride
void setTransaction(HTTPTransaction *txn) noexceptoverride
void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexceptoverride
const char * string
Definition: Conv.cpp:212
void onUpgrade(UpgradeProtocol protocol) noexceptoverride
void onError(const HTTPException &error) noexceptoverride
int close(NetworkSocket s)
Definition: NetOps.cpp:90
void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexceptoverride