}
}
+void EncryptionLogic::DropRequests(const ConnectionID& connectionID)
+{
+ for (auto it = m_requestsMap.begin(); it != m_requestsMap.end();) {
+ if (it->second.conn.counter == connectionID.counter)
+ it = m_requestsMap.erase(it);
+ else
+ it++;
+ }
+}
+
void EncryptionLogic::KeyRetrieved(MsgKeyResponse response)
{
auto it = m_requestsMap.find(response.id);
void Crypt(const CryptoRequest &request);
void KeyRetrieved(MsgKeyResponse response);
-
+ void DropRequests(const ConnectionID& connectionID);
private:
IEncryptionService &m_service;
LogError("This should not happend! SecurityEvent was called on EncryptionService!");
}
+void EncryptionService::CustomHandle(const CloseEvent &event)
+{
+ // call the default handler
+ ThreadService::Handle(event);
+
+ m_logic.DropRequests(event.connectionID);
+}
+
} /* namespace CKM */
});
}
+ virtual void Event(const CloseEvent &event)
+ {
+ CreateEvent([this, event]() {
+ this->CustomHandle(event);
+ });
+ }
+
void Start();
void Stop();
// CustomHandle is used to bypass security check
void CustomHandle(const ReadEvent &event);
void CustomHandle(const SecurityEvent &event);
+ void CustomHandle(const CloseEvent &event);
private:
virtual void SetCommManager(CommMgr *manager);