Use a larger one when shared.
Closes #15953
case CURL_LOCK_DATA_SSL_SESSION:
#ifdef USE_SSL
if(!share->ssl_scache) {
- if(Curl_ssl_scache_create(8, 2, &share->ssl_scache))
+ /* There is no way (yet) for the application to configure the
+ * session cache size, shared between many transfers. As for curl
+ * itself, a high session count will impact startup time. Also, the
+ * scache is not optimized for several hundreds of peers. So,
+ * keep it at a reasonable level. */
+ if(Curl_ssl_scache_create(25, 2, &share->ssl_scache))
res = CURLSHE_NOMEM;
}
#else
#ifdef USE_SSL
if(!data->state.ssl_scache) {
- result = Curl_ssl_scache_create(data->set.general_ssl.max_ssl_sessions,
- 2, &data->state.ssl_scache);
+ /* There was no ssl session cache set via a share, so we create
+ * one just for this transfer alone. Most transfers talk to just
+ * one host, but redirects may involve several occasionally. */
+ result = Curl_ssl_scache_create(3, 2, &data->state.ssl_scache);
if(result)
return result;
}
#endif
set->dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
- /* Set the default size of the SSL session ID cache */
- set->general_ssl.max_ssl_sessions = 5;
/* Timeout every 24 hours by default */
set->general_ssl.ca_cache_timeout = 24 * 60 * 60;
};
struct ssl_general_config {
- size_t max_ssl_sessions; /* SSL session id cache size */
int ca_cache_timeout; /* Certificate store cache timeout (seconds) */
};