Skip to content

Commit f37bf92

Browse files
authored
fix: ignore ping command in connection keepalive logic (#480)
Fixes #479 ### Motivation The current keepalive logic is too lenient – merely receiving ping commands can keep the connection alive. ### Modifications Ignore ping command in connection keepalive logic.
1 parent 0a9b7d9 commit f37bf92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ClientConnection.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,9 @@ void ClientConnection::handleIncomingCommand(BaseCommand& incomingCmd) {
924924
case Ready: {
925925
// Since we are receiving data from the connection, we are assuming that for now the
926926
// connection is still working well.
927-
havePendingPingRequest_ = false;
927+
if (incomingCmd.type() != BaseCommand::PING) {
928+
havePendingPingRequest_ = false;
929+
}
928930

929931
// Handle normal commands
930932
switch (incomingCmd.type()) {

0 commit comments

Comments
 (0)