version_handler: Expire shouldn't fail
We want to make sure any sessions which expire are successfully removed,
even if we don't have the session in our map.
Change-Id: I50c7f74509945e29ab3c04ecbcf583a1a9ce0c92
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/bmc/version-handler/version_handler.cpp b/bmc/version-handler/version_handler.cpp
index 9918e33..fee62d9 100644
--- a/bmc/version-handler/version_handler.cpp
+++ b/bmc/version-handler/version_handler.cpp
@@ -127,21 +127,6 @@
bool VersionBlobHandler::close(uint16_t session)
{
- return cleanup(session);
-}
-
-bool VersionBlobHandler::stat(uint16_t session, blobs::BlobMeta* meta)
-{
- return false;
-}
-
-bool VersionBlobHandler::expire(uint16_t session)
-{
- return cleanup(session);
-}
-
-bool VersionBlobHandler::cleanup(uint16_t session)
-{
try
{
auto& pack = *sessionToBlob.at(session);
@@ -155,4 +140,16 @@
return false;
}
}
+
+bool VersionBlobHandler::stat(uint16_t session, blobs::BlobMeta* meta)
+{
+ return false;
+}
+
+bool VersionBlobHandler::expire(uint16_t session)
+{
+ close(session);
+ return true;
+}
+
} // namespace ipmi_flash