30 persistentCache_(cache),
35 std::shared_ptr<folly::Executor>
executor,
37 std::size_t cacheCapacity,
38 std::chrono::seconds syncInterval)
50 std::size_t cacheCapacity,
51 std::chrono::seconds syncInterval)
68 if (sessionCacheData) {
69 auto key =
getKey(identity);
70 sessionCacheData->addedTime =
timeUtil_->now();
78 auto key =
getKey(identity);
85 auto&
value = hit.value();
94 std::chrono::duration_cast<std::chrono::seconds>(
now -
value.addedTime);
107 auto key =
getKey(identity);
std::chrono::steady_clock::time_point now()
constexpr detail::Map< Move > move
folly::Optional< SSLSessionCacheData > getCacheDataForSession(SSL_SESSION *sess)
requires E e noexcept(noexcept(s.error(std::move(e))))
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
size_t size() const override
void setSSLSession(const std::string &identity, SSLSessionPtr session) noexceptoverride
std::shared_ptr< PersistentCache< K, SSLSessionCacheData > > persistentCache_
std::unique_ptr< SSL_SESSION, SessionDestructor > SSLSessionPtr
bool removeSSLSession(const std::string &identity) noexceptoverride
int SSL_SESSION_has_ticket(const SSL_SESSION *s)
SSL_SESSION * getSessionFromCacheData(const SSLSessionCacheData &data)
SSLSessionPtr getSSLSession(const std::string &identity) const noexceptoverride
static const char *const value
unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s)
std::unique_ptr< TimeUtil > timeUtil_
constexpr int DEFAULT_CACHE_SYNC_RETRIES
virtual K getKey(const std::string &identity) const =0
SSLSessionPersistentCacheBase(std::shared_ptr< PersistentCache< K, SSLSessionCacheData >> cache)