2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#1578] also fixed report values

This commit is contained in:
Razvan Becheriu
2021-01-08 15:47:54 +02:00
parent d278be82e9
commit 6345ac8ca0
2 changed files with 3 additions and 3 deletions

View File

@@ -341,9 +341,9 @@ CommunicationState::getReport() const {
report->set("unacked-clients", Element::create(static_cast<long long>(getUnackedClientsCount())));
long long unacked_clients_left = 0;
if (isCommunicationInterrupted() && (config_->getMaxUnackedClients() > getUnackedClientsCount())) {
if (isCommunicationInterrupted() && (config_->getMaxUnackedClients() >= getUnackedClientsCount())) {
unacked_clients_left = static_cast<long long>(config_->getMaxUnackedClients() -
getUnackedClientsCount());
getUnackedClientsCount() + 1);
}
report->set("unacked-clients-left", Element::create(unacked_clients_left));
report->set("analyzed-packets", Element::create(static_cast<long long>(getAnalyzedMessagesCount())));

View File

@@ -775,7 +775,7 @@ TEST_F(CommunicationStateTest, getReport) {
" \"communication-interrupted\": true,"
" \"connecting-clients\": 2,"
" \"unacked-clients\": 1,"
" \"unacked-clients-left\": 9,"
" \"unacked-clients-left\": 10,"
" \"analyzed-packets\": 2"
"}";
EXPECT_TRUE(isEquivalent(Element::fromJSON(expected), report));