From ae4941089631b2c6dc654430dd54e0d76b3a6ea5 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Wed, 14 Sep 2022 15:54:22 -0700 Subject: [PATCH] [C++] Reset `havePendingPingRequest` flag for any data received from broker --- pulsar-client-cpp/lib/ClientConnection.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pulsar-client-cpp/lib/ClientConnection.cc b/pulsar-client-cpp/lib/ClientConnection.cc index e6cab07cb9b08..a7278e626b0af 100644 --- a/pulsar-client-cpp/lib/ClientConnection.cc +++ b/pulsar-client-cpp/lib/ClientConnection.cc @@ -810,6 +810,10 @@ void ClientConnection::handleIncomingCommand() { } case Ready: { + // Since we are receiving data from the connection, we are assuming that for now the connection is + // still working well. + havePendingPingRequest_ = false; + // Handle normal commands switch (incomingCmd_.type()) { case BaseCommand::SEND_RECEIPT: { @@ -1165,7 +1169,6 @@ void ClientConnection::handleIncomingCommand() { case BaseCommand::PONG: { LOG_DEBUG(cnxString_ << "Received response to ping message"); - havePendingPingRequest_ = false; break; }