Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate definition of SingleEndpointHTTPSessionPool #48779

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/IO/HTTPCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ namespace
private:
const std::string host;
const UInt16 port;
bool https;
const bool https;
const String proxy_host;
const UInt16 proxy_port;
bool proxy_https;
bool resolve_host;
const bool proxy_https;
const bool resolve_host;

using Base = PoolBase<Poco::Net::HTTPClientSession>;

ObjectPtr allocObject() override
{
auto session = makeHTTPSessionImpl(host, port, https, true, resolve_host);
Expand All @@ -121,14 +123,14 @@ namespace

public:
SingleEndpointHTTPSessionPool(
const std::string & host_,
UInt16 port_,
bool https_,
const std::string & proxy_host_,
UInt16 proxy_port_,
bool proxy_https_,
size_t max_pool_size_,
bool resolve_host_ = true)
const std::string & host_,
UInt16 port_,
bool https_,
const std::string & proxy_host_,
UInt16 proxy_port_,
bool proxy_https_,
size_t max_pool_size_,
bool resolve_host_ = true)
: Base(static_cast<unsigned>(max_pool_size_), &Poco::Logger::get("HTTPSessionPool"))
, host(host_)
, port(port_)
Expand Down
16 changes: 1 addition & 15 deletions src/IO/HTTPCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ namespace DB

class HTTPServerResponse;

class SingleEndpointHTTPSessionPool : public PoolBase<Poco::Net::HTTPClientSession>
{
private:
const std::string host;
const UInt16 port;
const bool https;
using Base = PoolBase<Poco::Net::HTTPClientSession>;

ObjectPtr allocObject() override;

public:
SingleEndpointHTTPSessionPool(const std::string & host_, UInt16 port_, bool https_, size_t max_pool_size_);
};

class HTTPException : public Exception
{
public:
Expand Down Expand Up @@ -66,7 +52,7 @@ class HTTPException : public Exception
const char * className() const noexcept override { return "DB::HTTPException"; }
};

using PooledHTTPSessionPtr = SingleEndpointHTTPSessionPool::Entry;
using PooledHTTPSessionPtr = PoolBase<Poco::Net::HTTPClientSession>::Entry; // SingleEndpointHTTPSessionPool::Entry
using HTTPSessionPtr = std::shared_ptr<Poco::Net::HTTPClientSession>;

void setResponseDefaultHeaders(HTTPServerResponse & response, size_t keep_alive_timeout);
Expand Down