diff --git a/server/modules/filter/cache/cache_storage_api.h b/server/modules/filter/cache/cache_storage_api.h index 479420fb8..3d23ba842 100644 --- a/server/modules/filter/cache/cache_storage_api.h +++ b/server/modules/filter/cache/cache_storage_api.h @@ -29,7 +29,8 @@ typedef enum cache_result_bits CACHE_RESULT_ERROR = 0x03, CACHE_RESULT_OUT_OF_RESOURCES = 0x04, - CACHE_RESULT_STALE = 0x10000 /*< Possibly combined with OK and NOT_FOUND. */ + CACHE_RESULT_STALE = 0x10000, /*< Possibly combined with OK and NOT_FOUND. */ + CACHE_RESULT_DISCARDED = 0x20000, /*< Possibly combined with NOT_FOUND. */ } cache_result_bits_t; typedef uint32_t cache_result_t; @@ -39,6 +40,7 @@ typedef uint32_t cache_result_t; #define CACHE_RESULT_IS_ERROR(result) (result & CACHE_RESULT_ERROR) #define CACHE_RESULT_IS_OUT_OF_RESOURCES(result) (result & CACHE_RESULT_OUT_OF_RESOURCES) #define CACHE_RESULT_IS_STALE(result) (result & CACHE_RESULT_STALE) +#define CACHE_RESULT_IS_DISCARDED(result) (result & CACHE_RESULT_DISCARDED) typedef enum cache_flags { diff --git a/server/modules/filter/cache/storage/storage_inmemory/inmemorystorage.cc b/server/modules/filter/cache/storage/storage_inmemory/inmemorystorage.cc index a3163d23f..6b61ae49e 100644 --- a/server/modules/filter/cache/storage/storage_inmemory/inmemorystorage.cc +++ b/server/modules/filter/cache/storage/storage_inmemory/inmemorystorage.cc @@ -149,6 +149,7 @@ cache_result_t InMemoryStorage::do_get_value(const CACHE_KEY& key, uint32_t flag if (is_hard_stale) { m_entries.erase(i); + result |= CACHE_RESULT_DISCARDED; } else if (!is_soft_stale || include_stale) {