proxygen
FakeSessionCallbacks Class Reference
Inheritance diagram for FakeSessionCallbacks:
wangle::SSLSessionCallbacks wangle::SSLSessionCallbacks

Public Member Functions

void setSSLSession (const std::string &key, SSLSessionPtr session) noexceptoverride
 
SSLSessionPtr getSSLSession (const std::string &key) const noexceptoverride
 
bool removeSSLSession (const std::string &) noexceptoverride
 
size_t size () const override
 
void setSSLSession (const std::string &identity, SSLSessionPtr session) noexceptoverride
 
SSLSessionPtr getSSLSession (const std::string &identity) const noexceptoverride
 
bool removeSSLSession (const std::string &) noexceptoverride
 
- Public Member Functions inherited from wangle::SSLSessionCallbacks
virtual bool supportsPersistence () const noexcept
 
virtual ~SSLSessionCallbacks ()
 

Private Attributes

std::map< std::string, SSLSessionPtrcache_
 

Additional Inherited Members

- Static Public Member Functions inherited from wangle::SSLSessionCallbacks
static void attachCallbacksToContext (SSL_CTX *ctx, SSLSessionCallbacks *callbacks)
 
static void detachCallbacksFromContext (SSL_CTX *ctx, SSLSessionCallbacks *callbacks)
 
static SSLSessionCallbacksgetCacheFromContext (SSL_CTX *ctx)
 

Detailed Description

Definition at line 29 of file SSLSessionCallbackTest.cpp.

Member Function Documentation

SSLSessionPtr FakeSessionCallbacks::getSSLSession ( const std::string key) const
inlineoverridevirtualnoexcept

Implements wangle::SSLSessionCallbacks.

Definition at line 37 of file SSLSessionCallbackTest.cpp.

References folly::gen::move.

37  {
38  auto it = cache_.find(key);
39  if (it == cache_.end()) {
40  return SSLSessionPtr(nullptr);
41  }
42  auto sess = std::move(it->second);
43  cache_.erase(it);
44  return sess;
45  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< SSL_SESSION, SessionDestructor > SSLSessionPtr
Definition: SSLSession.h:32
std::map< std::string, SSLSessionPtr > cache_
SSLSessionPtr FakeSessionCallbacks::getSSLSession ( const std::string identity) const
inlineoverridevirtualnoexcept

Implements wangle::SSLSessionCallbacks.

Definition at line 37 of file ThreadSafeSSLSessionCacheTest.cpp.

References folly::gen::move.

38  {
39  auto it = cache_.find(identity);
40  if (it == cache_.end()) {
41  return SSLSessionPtr(nullptr);
42  }
43  auto sess = std::move(it->second);
44  cache_.erase(it);
45  return sess;
46  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< SSL_SESSION, SessionDestructor > SSLSessionPtr
Definition: SSLSession.h:32
std::map< std::string, SSLSessionPtr > cache_
bool FakeSessionCallbacks::removeSSLSession ( const std::string )
inlineoverridevirtualnoexcept

Implements wangle::SSLSessionCallbacks.

Definition at line 47 of file SSLSessionCallbackTest.cpp.

47  {
48  return true;
49  }
bool FakeSessionCallbacks::removeSSLSession ( const std::string )
inlineoverridevirtualnoexcept

Implements wangle::SSLSessionCallbacks.

Definition at line 48 of file ThreadSafeSSLSessionCacheTest.cpp.

48  {
49  return true;
50  }
void FakeSessionCallbacks::setSSLSession ( const std::string key,
SSLSessionPtr  session 
)
inlineoverridevirtualnoexcept

Implements wangle::SSLSessionCallbacks.

Definition at line 31 of file SSLSessionCallbackTest.cpp.

References folly::gen::move.

33  {
34  cache_.emplace(key, std::move(session));
35  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::map< std::string, SSLSessionPtr > cache_
void FakeSessionCallbacks::setSSLSession ( const std::string identity,
SSLSessionPtr  session 
)
inlineoverridevirtualnoexcept

Implements wangle::SSLSessionCallbacks.

Definition at line 31 of file ThreadSafeSSLSessionCacheTest.cpp.

References folly::gen::move.

33  {
34  cache_.emplace(identity, std::move(session));
35  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::map< std::string, SSLSessionPtr > cache_
size_t FakeSessionCallbacks::size ( ) const
inlineoverridevirtual

Reimplemented from wangle::SSLSessionCallbacks.

Definition at line 51 of file SSLSessionCallbackTest.cpp.

51  {
52  return cache_.size();
53  }
std::map< std::string, SSLSessionPtr > cache_

Member Data Documentation

std::map< std::string, SSLSessionPtr > FakeSessionCallbacks::cache_
mutableprivate

Definition at line 56 of file SSLSessionCallbackTest.cpp.


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