1
#pragma once
2

            
3
#include <cstdint>
4

            
5
#include "envoy/server/overload/overload_manager.h"
6
#include "envoy/upstream/upstream.h"
7

            
8
#include "source/common/http/codec_client.h"
9
#include "source/common/http/conn_pool_base.h"
10

            
11
namespace Envoy {
12
namespace Http {
13

            
14
namespace Http2 {
15

            
16
/**
17
 * Implementation of an active client for HTTP/2
18
 */
19
class ActiveClient : public MultiplexedActiveClientBase {
20
public:
21
  // Calculate the expected streams allowed for this host, based on both
22
  // configuration and cached SETTINGS.
23
  static uint32_t calculateInitialStreamsLimit(
24
      Http::HttpServerPropertiesCacheSharedPtr http_server_properties_cache,
25
      absl::optional<HttpServerPropertiesCache::Origin>& origin,
26
      Upstream::HostDescriptionConstSharedPtr host);
27

            
28
  ActiveClient(Envoy::Http::HttpConnPoolImplBase& parent,
29
               OptRef<Upstream::Host::CreateConnectionData> data);
30
};
31

            
32
ConnectionPool::InstancePtr
33
allocateConnPool(Event::Dispatcher& dispatcher, Random::RandomGenerator& random_generator,
34
                 Upstream::HostConstSharedPtr host, Upstream::ResourcePriority priority,
35
                 const Network::ConnectionSocket::OptionsSharedPtr& options,
36
                 const Network::TransportSocketOptionsConstSharedPtr& transport_socket_options,
37
                 Upstream::ClusterConnectivityState& state,
38
                 Server::OverloadManager& overload_manager,
39
                 absl::optional<HttpServerPropertiesCache::Origin> origin = absl::nullopt,
40
                 Http::HttpServerPropertiesCacheSharedPtr http_server_properties_cache = nullptr);
41

            
42
} // namespace Http2
43
} // namespace Http
44
} // namespace Envoy