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:
@@ -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())));
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user