Line data Source code
1 : #include "source/extensions/upstreams/http/generic/config.h" 2 : 3 : #include "source/extensions/upstreams/http/http/upstream_request.h" 4 : #include "source/extensions/upstreams/http/tcp/upstream_request.h" 5 : #include "source/extensions/upstreams/http/udp/upstream_request.h" 6 : 7 : namespace Envoy { 8 : namespace Extensions { 9 : namespace Upstreams { 10 : namespace Http { 11 : namespace Generic { 12 : 13 : using UpstreamProtocol = Envoy::Router::GenericConnPoolFactory::UpstreamProtocol; 14 : 15 : Router::GenericConnPoolPtr GenericGenericConnPoolFactory::createGenericConnPool( 16 : Upstream::ThreadLocalCluster& thread_local_cluster, UpstreamProtocol upstream_protocol, 17 : Upstream::ResourcePriority priority, absl::optional<Envoy::Http::Protocol> downstream_protocol, 18 251 : Upstream::LoadBalancerContext* ctx) const { 19 251 : Router::GenericConnPoolPtr conn_pool; 20 251 : switch (upstream_protocol) { 21 251 : case UpstreamProtocol::HTTP: 22 251 : conn_pool = std::make_unique<Upstreams::Http::Http::HttpConnPool>( 23 251 : thread_local_cluster, priority, downstream_protocol, ctx); 24 251 : return (conn_pool->valid() ? std::move(conn_pool) : nullptr); 25 0 : case UpstreamProtocol::TCP: 26 0 : conn_pool = 27 0 : std::make_unique<Upstreams::Http::Tcp::TcpConnPool>(thread_local_cluster, priority, ctx); 28 0 : return (conn_pool->valid() ? std::move(conn_pool) : nullptr); 29 0 : case UpstreamProtocol::UDP: 30 0 : conn_pool = std::make_unique<Upstreams::Http::Udp::UdpConnPool>(thread_local_cluster, ctx); 31 0 : return (conn_pool->valid() ? std::move(conn_pool) : nullptr); 32 251 : } 33 : 34 0 : return nullptr; 35 251 : } 36 : 37 : REGISTER_FACTORY(GenericGenericConnPoolFactory, Router::GenericConnPoolFactory); 38 : 39 : } // namespace Generic 40 : } // namespace Http 41 : } // namespace Upstreams 42 : } // namespace Extensions 43 : } // namespace Envoy