proxygen
|
#include <SSLSessionCacheManager.h>
Public Member Functions | |
ShardedLocalSSLSessionCache (uint32_t n_buckets, uint32_t maxCacheSize, uint32_t cacheCullSize) | |
SSL_SESSION * | lookupSession (const std::string &sessionId) |
void | storeSession (const std::string &sessionId, SSL_SESSION *session, SSLStats *stats) |
void | removeSession (const std::string &sessionId) |
size_t | hash (const std::string &key) |
Public Attributes | |
std::vector< std::unique_ptr< LocalSSLSessionCache > > | caches_ |
A sharded LRU for SSL sessions. The sharding is inteneded to reduce contention for the LRU locks. Assuming uniform distribution, two workers will contend for the same lock with probability 1 / n_buckets^2.
Definition at line 63 of file SSLSessionCacheManager.h.
wangle::ShardedLocalSSLSessionCache::ShardedLocalSSLSessionCache | ( | uint32_t | n_buckets, |
uint32_t | maxCacheSize, | ||
uint32_t | cacheCullSize | ||
) |
Definition at line 73 of file SSLSessionCacheManager.cpp.
References i, wangle::LocalSSLSessionCache::LocalSSLSessionCache(), and uint32_t.
|
inline |
Definition at line 75 of file SSLSessionCacheManager.h.
Referenced by TEST().
SSL_SESSION * wangle::ShardedLocalSSLSessionCache::lookupSession | ( | const std::string & | sessionId | ) |
Definition at line 92 of file SSLSessionCacheManager.cpp.
References folly::EvictingCacheMap< TKey, TValue, THash, TKeyEqual >::end(), g(), wangle::LocalSSLSessionCache::lock, and wangle::LocalSSLSessionCache::sessionCache.
void wangle::ShardedLocalSSLSessionCache::removeSession | ( | const std::string & | sessionId | ) |
Definition at line 134 of file SSLSessionCacheManager.cpp.
References g(), and wangle::LocalSSLSessionCache::lock.
void wangle::ShardedLocalSSLSessionCache::storeSession | ( | const std::string & | sessionId, |
SSL_SESSION * | session, | ||
SSLStats * | stats | ||
) |
Definition at line 109 of file SSLSessionCacheManager.cpp.
References folly::EvictingCacheMap< TKey, TValue, THash, TKeyEqual >::end(), g(), wangle::LocalSSLSessionCache::lock, wangle::SSLStats::recordSSLSessionFree(), wangle::LocalSSLSessionCache::removedSessions_, and wangle::LocalSSLSessionCache::sessionCache.
std::vector< std::unique_ptr<LocalSSLSessionCache> > wangle::ShardedLocalSSLSessionCache::caches_ |
Definition at line 79 of file SSLSessionCacheManager.h.