blob: b50c2acbc5500e794926961ebd2ca47da3ab1da0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#pragma once
#include <Poco/Net/TCPServerConnection.h>
#include <Server/IServer.h>
#include <Server/TCPProtocolStackData.h>
namespace DB
{
class ProxyV1Handler : public Poco::Net::TCPServerConnection
{
using StreamSocket = Poco::Net::StreamSocket;
public:
explicit ProxyV1Handler(const StreamSocket & socket, IServer & server_, const std::string & conf_name_, TCPProtocolStackData & stack_data_)
: Poco::Net::TCPServerConnection(socket), log(&Poco::Logger::get("ProxyV1Handler")), server(server_), conf_name(conf_name_), stack_data(stack_data_) {}
void run() override;
protected:
bool readWord(int max_len, std::string & word, bool & eol);
private:
Poco::Logger * log;
IServer & server;
std::string conf_name;
TCPProtocolStackData & stack_data;
};
}
|