mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Move SSL session data deserialization up out of the session cache
storage providers; includes a significant change to the shmcb storage structure: * modules/ssl/ssl_private.h (modssl_sesscache_provider): Change retrieve function to take dest/destlen output buffer, to take a constant id paramater, and to return a BOOL. * modules/ssl/ssl_scache.c (ssl_scache_retrieve): Update accordingly, perform SSL deserialization here. * modules/ssl/ssl_scache_dc.c (ssl_scache_dc_retrieve), modules/ssl/ssl_scache_dbm.c (ssl_scache_dbm_retrieve), modules/ssl/ssl_scache_memcache.c (ssl_scache_mc_retrieve): Update accordingly. * modules/ssl/ssl_scache_shmcb.c: Store the whole ID in the cache before the data, so that each index can be compared against the requested ID without deserializing the data. This requires approx 20% extra storage per session in the common case, though should reduce CPU overhead in some retrieval paths. (SHMCBIndex): Replace s_id2 field with id_len. (shmcb_cyclic_memcmp): New function. (ssl_scache_shmcb_init): Change the heuristics to allow for increase in per-session storage requirement. (ssl_scache_shmcb_retrieve): Drop requirement on ID length. (shmcb_subcache_store): Store the ID in the cyclic buffer. (shmcb_subcache_retrieve, shmcb_subcache_remove): Compare against the stored ID rather than deserializing the data. (ssl_scache_shmcb_retrieve, ssl_scache_shmcb_store): Update accordingly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630307 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -88,8 +88,17 @@ SSL_SESSION *ssl_scache_retrieve(server_rec *s, UCHAR *id, int idlen,
|
||||
apr_pool_t *p)
|
||||
{
|
||||
SSLModConfigRec *mc = myModConfig(s);
|
||||
unsigned char dest[SSL_SESSION_MAX_DER];
|
||||
unsigned int destlen = SSL_SESSION_MAX_DER;
|
||||
MODSSL_D2I_SSL_SESSION_CONST unsigned char *ptr;
|
||||
|
||||
if (mc->sesscache->retrieve(s, id, idlen, dest, &destlen, p) == FALSE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return mc->sesscache->retrieve(s, id, idlen, p);
|
||||
ptr = dest;
|
||||
|
||||
return d2i_SSL_SESSION(NULL, &ptr, destlen);
|
||||
}
|
||||
|
||||
void ssl_scache_remove(server_rec *s, UCHAR *id, int idlen,
|
||||
|
Reference in New Issue
Block a user