proxygen
ResponseHandler.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 ExMessageHandler;
17 class RequestHandler;
18 class PushHandler;
19 
45  public:
46  explicit ResponseHandler(RequestHandler* upstream)
47  : upstream_(CHECK_NOTNULL(upstream)) {
48  }
49 
50  virtual ~ResponseHandler() {}
51 
59  virtual void sendHeaders(HTTPMessage& msg) noexcept = 0;
60 
61  virtual void sendChunkHeader(size_t len) noexcept = 0;
62 
63  virtual void sendBody(std::unique_ptr<folly::IOBuf> body) noexcept = 0;
64 
65  virtual void sendChunkTerminator() noexcept = 0;
66 
67  virtual void sendEOM() noexcept = 0;
68 
69  virtual void sendAbort() noexcept = 0;
70 
71  virtual void refreshTimeout() noexcept = 0;
72 
73  virtual void pauseIngress() noexcept = 0;
74 
75  virtual void resumeIngress() noexcept = 0;
76 
78  PushHandler* pushHandler) noexcept = 0;
79 
81  bool /*unidirectional*/ = false)
82  noexcept {
83  LOG(FATAL) << "newExMessage not supported";
84  }
85 
86  // Accessors for Transport/Connection information
87  virtual const wangle::TransportInfo& getSetupTransportInfo() const
88  noexcept = 0;
89 
90  virtual void getCurrentTransportInfo(wangle::TransportInfo* tinfo) const = 0;
91 
93  return txn_;
94  }
95 
96  protected:
98  HTTPTransaction* txn_{nullptr};
99 };
100 
101 }
virtual void sendChunkTerminator() noexcept=0
virtual ResponseHandler * newExMessage(ExMessageHandler *, bool=false) noexcept
virtual void sendEOM() noexcept=0
virtual void getCurrentTransportInfo(wangle::TransportInfo *tinfo) const =0
HTTPTransaction * getTransaction() const noexcept
virtual void sendChunkHeader(size_t len) noexcept=0
HTTPTransaction * txn_
requires E e noexcept(noexcept(s.error(std::move(e))))
virtual void sendAbort() noexcept=0
virtual void resumeIngress() noexcept=0
virtual void sendHeaders(HTTPMessage &msg) noexcept=0
virtual void sendBody(std::unique_ptr< folly::IOBuf > body) noexcept=0
RequestHandler * upstream_
virtual const wangle::TransportInfo & getSetupTransportInfo() const noexcept=0
const
Definition: upload.py:398
virtual void refreshTimeout() noexcept=0
virtual void pauseIngress() noexcept=0
ResponseHandler(RequestHandler *upstream)
virtual ResponseHandler * newPushedResponse(PushHandler *pushHandler) noexcept=0