proxygen
SessionWrapper.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 ProxyService {
16  private:
18 
19  public:
21  : session_(session) {
23  }
24 
25  ~SessionWrapper() override {
26  if (session_) {
27  session_->drain();
28  }
29  }
30 
32  return session_;
33  }
34 
35  // Note: you must not start any asynchronous work from onDestroy()
36  void onDestroy(const proxygen::HTTPSessionBase&) override {
37  session_ = nullptr;
38  }
39 };
40 
41 }
void onDestroy(const proxygen::HTTPSessionBase &) override
SessionWrapper(proxygen::HTTPUpstreamSession *session)
proxygen::HTTPUpstreamSession * session_
proxygen::HTTPUpstreamSession * operator->() const
void setInfoCallback(InfoCallback *callback)