mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 03:42:48 +00:00
fix, add some introspection functionality
This commit is contained in:
parent
ee74d0de8c
commit
6378184c7f
@ -16,7 +16,7 @@ ReadBufferFromPocoSocketChunked::ReadBufferFromPocoSocketChunked(Poco::Net::Sock
|
||||
{}
|
||||
|
||||
ReadBufferFromPocoSocketChunked::ReadBufferFromPocoSocketChunked(Poco::Net::Socket & socket_, const ProfileEvents::Event & read_event_, size_t buf_size)
|
||||
: ReadBuffer(nullptr, 0), log(getLogger("Protocol")), buffer_socket(socket_, read_event_, buf_size)
|
||||
: ReadBuffer(nullptr, 0), log(getLogger("Protocol")), peer_address(socket_.peerAddress()), our_address(socket_.address()), buffer_socket(socket_, read_event_, buf_size)
|
||||
{
|
||||
chassert(buf_size <= std::numeric_limits<decltype(chunk_left)>::max());
|
||||
|
||||
@ -28,6 +28,7 @@ void ReadBufferFromPocoSocketChunked::enableChunked()
|
||||
{
|
||||
chunked = true;
|
||||
buffer_socket.position() = pos;
|
||||
working_buffer.resize(offset());
|
||||
}
|
||||
|
||||
bool ReadBufferFromPocoSocketChunked::poll(size_t timeout_microseconds)
|
||||
|
@ -18,6 +18,9 @@ public:
|
||||
|
||||
bool hasBufferedData() const { return hasPendingData() || buffer_socket.hasPendingData(); }
|
||||
|
||||
Poco::Net::SocketAddress peerAddress() { return peer_address; }
|
||||
Poco::Net::SocketAddress ourAddress() { return our_address; }
|
||||
|
||||
protected:
|
||||
bool startChunk();
|
||||
bool nextChunk();
|
||||
@ -25,6 +28,8 @@ protected:
|
||||
|
||||
private:
|
||||
LoggerPtr log;
|
||||
Poco::Net::SocketAddress peer_address;
|
||||
Poco::Net::SocketAddress our_address;
|
||||
ReadBufferFromPocoSocket buffer_socket;
|
||||
bool chunked = false;
|
||||
UInt32 chunk_left = 0; // chunk left to read from socket
|
||||
|
@ -54,6 +54,16 @@ protected:
|
||||
|
||||
WriteBufferFromPocoSocket::nextImpl();
|
||||
}
|
||||
|
||||
Poco::Net::SocketAddress peerAddress()
|
||||
{
|
||||
return peer_address;
|
||||
}
|
||||
|
||||
Poco::Net::SocketAddress ourAddress()
|
||||
{
|
||||
return our_address;
|
||||
}
|
||||
private:
|
||||
LoggerPtr log;
|
||||
bool chunked = false;
|
||||
|
Loading…
Reference in New Issue
Block a user