proxygen
HTTPSessionController.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 
12 #include <chrono>
13 #include <glog/logging.h>
15 
16 namespace folly {
17 class SocketAddress;
18 }
19 
20 namespace proxygen {
21 
22 class HTTPException;
23 class HTTPMessage;
24 class HTTPSessionBase;
25 class HTTPTransaction;
26 class HTTPTransactionHandler;
27 
29  public:
31 
43  virtual HTTPTransactionHandler* getRequestHandler(
44  HTTPTransaction& txn, HTTPMessage* msg) = 0;
45 
52  virtual HTTPTransactionHandler* getParseErrorHandler(
53  HTTPTransaction* txn,
54  const HTTPException& error,
55  const folly::SocketAddress& localAddress) = 0;
56 
60  virtual HTTPTransactionHandler* getTransactionTimeoutHandler(
61  HTTPTransaction* txn,
62  const folly::SocketAddress& localAddress) = 0;
63 
67  virtual void attachSession(HTTPSessionBase* session) = 0;
68 
72  virtual void detachSession(const HTTPSessionBase* session) = 0;
73 
77  virtual void onSessionCodecChange(HTTPSessionBase* /*session*/) {}
78 
82  virtual std::chrono::milliseconds getGracefulShutdownTimeout() const {
83  return std::chrono::milliseconds(0);
84  }
85 
89  virtual std::chrono::milliseconds getSessionFlowControlTimeout() const {
90  return std::chrono::milliseconds(0);
91  }
92 
97  return HeaderIndexingStrategy::getDefaultInstance();
98  }
99 };
100 
101 
104  HTTPMessage* /*msg*/) final {
105  LOG(FATAL) << "Unreachable";
106  return nullptr;
107  }
108 
116  HTTPTransaction* /*txn*/,
117  const HTTPException& /*error*/,
118  const folly::SocketAddress& /*localAddress*/) final {
119  LOG(FATAL) << "Unreachable";
120  return nullptr;
121  }
122 
127  HTTPTransaction* /*txn*/,
128  const folly::SocketAddress& /*localAddress*/) final {
129  LOG(FATAL) << "Unreachable";
130  return nullptr;
131  }
132 };
133 
134 } // proxygen
virtual std::chrono::milliseconds getGracefulShutdownTimeout() const
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
HTTPTransactionHandler * getRequestHandler(HTTPTransaction &, HTTPMessage *) final
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
virtual void onSessionCodecChange(HTTPSessionBase *)
HTTPTransactionHandler * getParseErrorHandler(HTTPTransaction *, const HTTPException &, const folly::SocketAddress &) final
virtual const HeaderIndexingStrategy * getHeaderIndexingStrategy() const
virtual std::chrono::milliseconds getSessionFlowControlTimeout() const
HTTPTransactionHandler * getTransactionTimeoutHandler(HTTPTransaction *, const folly::SocketAddress &) final