mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 01:30:51 +00:00
Merge pull request #17365 from Avogar/benchmark-bug
Add eof check in receiveHello
This commit is contained in:
commit
c3a49c0947
@ -207,6 +207,12 @@ void Connection::receiveHello()
|
|||||||
/// Receive hello packet.
|
/// Receive hello packet.
|
||||||
UInt64 packet_type = 0;
|
UInt64 packet_type = 0;
|
||||||
|
|
||||||
|
/// Prevent read after eof in readVarUInt in case of reset connection
|
||||||
|
/// (Poco should throw such exception while reading from socket but
|
||||||
|
/// sometimes it doesn't for unknown reason)
|
||||||
|
if (in->eof())
|
||||||
|
throw Poco::Net::NetException("Connection reset by peer");
|
||||||
|
|
||||||
readVarUInt(packet_type, *in);
|
readVarUInt(packet_type, *in);
|
||||||
if (packet_type == Protocol::Server::Hello)
|
if (packet_type == Protocol::Server::Hello)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user