proxygen
RequestHandlerAdaptor.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 
14 
15 namespace proxygen {
16 
17 class RequestHandler;
18 class PushHandler;
19 
36  : public HTTPTransactionHandler,
37  public ResponseHandler {
38  public:
39  explicit RequestHandlerAdaptor(RequestHandler* requestHandler);
40 
41  private:
42  // HTTPTransactionHandler
43  void setTransaction(HTTPTransaction* txn) noexcept override;
44  void detachTransaction() noexcept override;
45  void onHeadersComplete(std::unique_ptr<HTTPMessage> msg) noexcept override;
46  void onBody(std::unique_ptr<folly::IOBuf> chain) noexcept override;
47  void onChunkHeader(size_t length) noexcept override;
48  void onChunkComplete() noexcept override;
49  void onTrailers(std::unique_ptr<HTTPHeaders> trailers) noexcept override;
50  void onEOM() noexcept override;
51  void onUpgrade(UpgradeProtocol protocol) noexcept override;
52  void onError(const HTTPException& error) noexcept override;
53  void onEgressPaused() noexcept override;
54  void onEgressResumed() noexcept override;
55  void onExTransaction(HTTPTransaction* txn) noexcept override;
56 
57  // ResponseHandler
58  void sendHeaders(HTTPMessage& msg) noexcept override;
59  void sendChunkHeader(size_t len) noexcept override;
60  void sendBody(std::unique_ptr<folly::IOBuf> body) noexcept override;
61  void sendChunkTerminator() noexcept override;
62  void sendEOM() noexcept override;
63  void sendAbort() noexcept override;
64  void refreshTimeout() noexcept override;
65  void pauseIngress() noexcept override;
66  void resumeIngress() noexcept override;
68  PushHandler* pushHandler) noexcept override;
70  bool unidirectional) noexcept override;
71  const wangle::TransportInfo& getSetupTransportInfo() const noexcept override;
72  void getCurrentTransportInfo(wangle::TransportInfo* tinfo) const override;
73 
74  // Helper method
76 
78 };
79 
80 }
void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexceptoverride
void setTransaction(HTTPTransaction *txn) noexceptoverride
RequestHandlerAdaptor(RequestHandler *requestHandler)
void onError(const HTTPException &error) noexceptoverride
void detachTransaction() noexceptoverride
void sendHeaders(HTTPMessage &msg) noexceptoverride
void sendChunkTerminator() noexceptoverride
ResponseHandler * newPushedResponse(PushHandler *pushHandler) noexceptoverride
const wangle::TransportInfo & getSetupTransportInfo() const noexceptoverride
ResponseHandler * newExMessage(ExMessageHandler *exHandler, bool unidirectional) noexceptoverride
requires E e noexcept(noexcept(s.error(std::move(e))))
void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexceptoverride
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
void onChunkHeader(size_t length) noexceptoverride
void onExTransaction(HTTPTransaction *txn) noexceptoverride
void onUpgrade(UpgradeProtocol protocol) noexceptoverride
void sendBody(std::unique_ptr< folly::IOBuf > body) noexceptoverride
void getCurrentTransportInfo(wangle::TransportInfo *tinfo) const override
void onBody(std::unique_ptr< folly::IOBuf > chain) noexceptoverride
void setError(ProxygenError err) noexcept
void onChunkComplete() noexceptoverride
void sendChunkHeader(size_t len) noexceptoverride