proxygen
wangle::LocalSSLSessionCache Class Reference

#include <SSLSessionCacheManager.h>

Inheritance diagram for wangle::LocalSSLSessionCache:

Public Member Functions

 LocalSSLSessionCache (uint32_t maxCacheSize, uint32_t cacheCullSize)
 
 ~LocalSSLSessionCache ()
 

Public Attributes

SSLSessionCacheMap sessionCache
 
std::mutex lock
 
uint32_t removedSessions_ {0}
 

Private Member Functions

void pruneSessionCallback (const std::string &sessionId, SSL_SESSION *session)
 

Detailed Description

Holds an SSLSessionCacheMap and associated lock

Definition at line 38 of file SSLSessionCacheManager.h.

Constructor & Destructor Documentation

wangle::LocalSSLSessionCache::LocalSSLSessionCache ( uint32_t  maxCacheSize,
uint32_t  cacheCullSize 
)

Definition at line 55 of file SSLSessionCacheManager.cpp.

References folly::netops::bind(), pruneSessionCallback(), sessionCache, and folly::EvictingCacheMap< TKey, TValue, THash, TKeyEqual >::setPruneHook().

Referenced by wangle::ShardedLocalSSLSessionCache::ShardedLocalSSLSessionCache().

57  : sessionCache(maxCacheSize, cacheCullSize) {
60  this, std::placeholders::_1,
61  std::placeholders::_2));
62 }
void pruneSessionCallback(const std::string &sessionId, SSL_SESSION *session)
int bind(NetworkSocket s, const sockaddr *name, socklen_t namelen)
Definition: NetOps.cpp:76
void setPruneHook(PruneHookCall pruneHook)
wangle::LocalSSLSessionCache::~LocalSSLSessionCache ( )
inline

Definition at line 42 of file SSLSessionCacheManager.h.

References folly::EvictingCacheMap< TKey, TValue, THash, TKeyEqual >::clear(), g(), lock, and sessionCache.

42  {
43  std::lock_guard<std::mutex> g(lock);
44  // EvictingCacheMap dtor doesn't free values
46  }
g_t g(f_t)
void clear(PruneHookCall pruneHook=nullptr)

Member Function Documentation

void wangle::LocalSSLSessionCache::pruneSessionCallback ( const std::string sessionId,
SSL_SESSION *  session 
)
private

Definition at line 64 of file SSLSessionCacheManager.cpp.

References wangle::SSLUtil::hexlify(), and removedSessions_.

Referenced by LocalSSLSessionCache().

65  {
66  VLOG(4) << "Free SSL session from local cache; id="
67  << SSLUtil::hexlify(sessionId);
68  SSL_SESSION_free(session);
70 }
static std::string hexlify(const std::string &binary)
Definition: SSLUtil.h:150

Member Data Documentation

uint32_t wangle::LocalSSLSessionCache::removedSessions_ {0}

The documentation for this class was generated from the following files: