#pragma once #include #include #include #include #include #include namespace CurrentMetrics { extern const Metric InterserverConnection; } namespace DB { class IServer; class WriteBufferFromHTTPServerResponse; class InterserverIOHTTPHandler : public HTTPRequestHandler { public: explicit InterserverIOHTTPHandler(IServer & server_) : server(server_) , log(&Poco::Logger::get("InterserverIOHTTPHandler")) { } void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response, const ProfileEvents::Event & write_event) override; private: struct Output { std::shared_ptr out; }; IServer & server; Poco::Logger * log; CurrentMetrics::Increment metric_increment{CurrentMetrics::InterserverConnection}; void processQuery(HTTPServerRequest & request, HTTPServerResponse & response, Output & used_output); std::pair checkAuthentication(HTTPServerRequest & request) const; }; }