]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1959] Minor changes in ha_service
authorMarcin Siodelski <marcin@isc.org>
Mon, 20 Sep 2021 18:37:24 +0000 (20:37 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 22 Sep 2021 06:13:15 +0000 (08:13 +0200)
Added a comment to unsent-update-count and added a line break as a result
of the review.

src/hooks/dhcp/high_availability/ha_service.cc

index 81a72f1a83dd4af4c09175e5132bf0f7ee3646a7..b6b97a6ecc7533cbde07ab9424012c7eba15cb8d 100644 (file)
@@ -1710,13 +1710,19 @@ HAService::asyncSendHeartbeat() {
                         // if we failed here.
                     }
 
+                    // unsent-update-count was not present in earlier HA versions.
+                    // Let's check if the partner has sent the parameter. We initialized
+                    // the counter to 0, and it remains 0 if the partner doesn't send it.
+                    // It effectively means that we don't track partner's unsent updates
+                    // as in the earlier HA versions.
                     auto unsent_update_count = args->get("unsent-update-count");
                     if (unsent_update_count) {
                         if (unsent_update_count->getType() != Element::integer) {
                             isc_throw(CtrlChannelError, "unsent-update-count returned in"
                                       " the ha-heartbeat response is not an integer");
                         }
-                        communication_state_->setPartnerUnsentUpdateCount(static_cast<uint64_t>(unsent_update_count->intValue()));
+                        communication_state_->setPartnerUnsentUpdateCount(static_cast<uint64_t>
+                                                                          (unsent_update_count->intValue()));
                     }
 
                 } catch (const std::exception& ex) {