Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-13147
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Nov 23, 2023
1 parent 2fccfd7 commit 45561de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/AP_WS_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace OpenWifi {
fmt::format(
"{}: Session seems idle. Controller disconnecting device.",
hint->second.second->SerialNumber_));
SessionsToRemove.emplace_back();
SessionsToRemove.emplace_back(hint->second.first);
Garbage_.push_back(hint->second.second);
hint = SerialNumbers_[hashIndex].erase(hint);
} else if (hint->second.second->State_.Connected) {
Expand All @@ -216,9 +216,10 @@ namespace OpenWifi {
}
}

{
if(SessionsToRemove.empty()) {
poco_information(Logger(), fmt::format("Removing {} sessions.", SessionsToRemove.size()));
std::lock_guard L1(WSServerMutex_);
for(const auto &Session:SessionsToRemove) {
for (const auto &Session : SessionsToRemove) {
Sessions_.erase(Session);
}
}
Expand Down

0 comments on commit 45561de

Please sign in to comment.