stephb9959
2023-12-01 23:51:18 -08:00
parent 0288d905b7
commit 3f06f00a88
3 changed files with 11 additions and 6 deletions

2
build
View File

@@ -1 +1 @@
38
39

View File

@@ -76,13 +76,17 @@ namespace OpenWifi {
}
AP_WS_Connection::~AP_WS_Connection() {
poco_information(Logger_, fmt::format("DESTRUCTOR({}): Session={} Connection closed.", SerialNumber_,
poco_information(Logger_, fmt::format("DESTRUCTOR({}): 0 - Session={} Connection closed.", SerialNumber_,
State_.sessionId));
std::lock_guard G(ConnectionMutex_);
EndConnection();
poco_information(Logger_, fmt::format("DESTRUCTOR({}): 1 - Session={} Connection closed.", SerialNumber_,
State_.sessionId));
EndConnection(false);
poco_information(Logger_, fmt::format("DESTRUCTOR({}): 2 - Session={} Connection closed.", SerialNumber_,
State_.sessionId));
}
void AP_WS_Connection::EndConnection() {
void AP_WS_Connection::EndConnection(bool Clean) {
bool expectedValue=false;
if (Dead_.compare_exchange_strong(expectedValue,true,std::memory_order_release,std::memory_order_relaxed)) {
@@ -110,7 +114,8 @@ namespace OpenWifi {
Cleanup.detach();
}
AP_WS_Server()->EndSession(State_.sessionId, SerialNumberInt_);
if(Clean)
AP_WS_Server()->EndSession(State_.sessionId, SerialNumberInt_);
}
}

View File

@@ -30,7 +30,7 @@ namespace OpenWifi {
Poco::Logger &L, std::pair<Poco::Net::SocketReactor *, LockedDbSession *> R);
~AP_WS_Connection();
void EndConnection();
void EndConnection(bool Clean = true);
void ProcessJSONRPCEvent(Poco::JSON::Object::Ptr &Doc);
void ProcessJSONRPCResult(Poco::JSON::Object::Ptr Doc);
void ProcessIncomingFrame();