Skip to content

Commit 70872e9

Browse files
authored
Merge pull request ClickHouse#52883 from ClickHouse/backport/22.8/52833
Backport ClickHouse#52833 to 22.8: clickhouse-keeper: fix implementation of server with poll()
2 parents 8feecff + f8f0e8b commit 70872e9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Server/KeeperTCPHandler.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,13 @@ struct SocketInterruptablePollWrapper
169169
}
170170
while (rc < 0 && errno == POCO_EINTR);
171171

172-
if (rc >= 1 && poll_buf[0].revents & POLLIN)
173-
socket_ready = true;
174-
if (rc >= 2 && poll_buf[1].revents & POLLIN)
175-
fd_ready = true;
172+
if (rc >= 1)
173+
{
174+
if (poll_buf[0].revents & POLLIN)
175+
socket_ready = true;
176+
if (poll_buf[1].revents & POLLIN)
177+
fd_ready = true;
178+
}
176179
#endif
177180
}
178181

0 commit comments

Comments
 (0)