diff options
author | Todd Short <tshort@akamai.com> | 2019-04-05 14:17:22 -0400 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-06-10 18:32:25 +1000 |
commit | 25959e04c350c2b82d545ea38b18ff714acf61ba (patch) | |
tree | 7fd75f13eee0b56bfccea99f18d78bcbe85ba4b8 /ssl/ssl_local.h | |
parent | de5a0198b22c36884fd36021d9e4f589b939674f (diff) |
Optimize session cache flushing
Sort SSL_SESSION structures by timeout in the linked list.
Iterate over the linked list for timeout, stopping when no more
session can be flushed.
Do SSL_SESSION_free() outside of SSL_CTX lock
Update timeout upon use
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8687)
Diffstat (limited to 'ssl/ssl_local.h')
-rw-r--r-- | ssl/ssl_local.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ssl/ssl_local.h b/ssl/ssl_local.h index 09413a44fa..def53739a1 100644 --- a/ssl/ssl_local.h +++ b/ssl/ssl_local.h @@ -593,8 +593,10 @@ struct ssl_session_st { */ long verify_result; /* only for servers */ CRYPTO_REF_COUNT references; - long timeout; - long time; + time_t timeout; + time_t time; + time_t calc_timeout; + int timeout_ovf; unsigned int compress_meth; /* Need to lookup the method */ const SSL_CIPHER *cipher; unsigned long cipher_id; /* when ASN.1 loaded, this needs to be used to @@ -634,6 +636,7 @@ struct ssl_session_st { unsigned char *ticket_appdata; size_t ticket_appdata_len; uint32_t flags; + SSL_CTX *owner; CRYPTO_RWLOCK *lock; }; @@ -2843,6 +2846,8 @@ int ssl_srp_ctx_init_intern(SSL *s); int ssl_srp_calc_a_param_intern(SSL *s); int ssl_srp_server_param_with_username_intern(SSL *s, int *ad); +void ssl_session_calculate_timeout(SSL_SESSION* ss); + # else /* OPENSSL_UNIT_TEST */ # define ssl_init_wbio_buffer SSL_test_functions()->p_ssl_init_wbio_buffer |