Home | History | Annotate | Download | only in socket

Lines Matching defs:session

205 // side policy for that cache about session re-use: we retain one session per
211 void OnSessionAdded(const HostPortPair& host_and_port, SSL_SESSION* session) {
212 // Declare the session cleaner-upper before the lock, so any call into
213 // OpenSSL to free the session will happen after the lock is released.
217 DCHECK_EQ(0U, session_map_.count(session));
219 host_port_map_.insert(std::make_pair(host_and_port, session));
223 res.first->second = session;
225 DVLOG(2) << "Adding session " << session << " => "
227 DCHECK(host_port_map_[host_and_port] == session);
228 session_map_[session] = res.first;
233 void OnSessionRemoved(SSL_SESSION* session) {
234 // Declare the session cleaner-upper before the lock, so any call into
235 // OpenSSL to free the session will happen after the lock is released.
239 SessionMap::iterator it = session_map_.find(session);
242 DVLOG(2) << "Remove session " << session << " => "
244 DCHECK(it->second->second == session);
247 session_to_free.reset(session);
251 // Looks up the host:port in the cache, and if a session is found it is added
258 DVLOG(2) << "Lookup session: " << it->second << " => "
260 SSL_SESSION* session = it->second;
261 DCHECK(session);
262 DCHECK(session_map_[session] == it);
264 // that opens a small risk |session| will go out of scope before it is used.
265 // Alternatively we would take a temporary local refcount on |session|,
268 return SSL_set_session(ssl, session) == 1;
273 // associated session.
329 static int NewSessionCallbackStatic(SSL* ssl, SSL_SESSION* session) {
330 return GetInstance()->NewSessionCallback(ssl, session);
333 int NewSessionCallback(SSL* ssl, SSL_SESSION* session) {
335 session_cache_.OnSessionAdded(socket->host_and_port(), session);
336 return 1; // 1 => We took ownership of |session|.
339 static void RemoveSessionCallbackStatic(SSL_CTX* ctx, SSL_SESSION* session) {
340 return GetInstance()->RemoveSessionCallback(ctx, session);
343 void RemoveSessionCallback(SSL_CTX* ctx, SSL_SESSION* session) {
345 session_cache_.OnSessionRemoved(session);
763 // doesn't require a client cert), we need to invalidate the SSL session
764 // so that we won't try to resume the non-client-authenticated session in
768 // Remove from session cache but don't clear this connection.
769 SSL_SESSION* session = SSL_get_session(ssl_);
770 if (session) {
771 int rv = SSL_CTX_remove_session(SSL_get_SSL_CTX(ssl_), session);
772 LOG_IF(WARNING, !rv) << "Couldn't invalidate SSL session: " << session;
777 DVLOG(2) << "Result of session reuse for " << host_and_port_.ToString()
1204 // We don't need to invalidate the non-client-authenticated SSL session