From a1dfa17653b3121ad712e5665e62cbe27e706115 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 22 Feb 2008 15:48:28 +0000 Subject: [PATCH] * modules/ssl/ssl_scache_shmcb.c: Describe the data structures used by shmcb (hopefully :), before some invasive surgery. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630228 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/ssl_scache_shmcb.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/modules/ssl/ssl_scache_shmcb.c b/modules/ssl/ssl_scache_shmcb.c index 8db5858ce8..ec46cedd30 100644 --- a/modules/ssl/ssl_scache_shmcb.c +++ b/modules/ssl/ssl_scache_shmcb.c @@ -86,6 +86,37 @@ typedef struct { unsigned char removed; } SHMCBIndex; + +/* The SHM data segment is of fixed size and stores data as follows. + * + * [ SHMCBHeader | Subcaches ] + * + * The SHMCBHeader header structure stores metadata concerning the + * cache and the contained subcaches. + * + * Subcaches is a hash table of header->subcache_num SHMCBSubcache + * structures. The hash table is indexed by SHMCB_MASK(id). Each + * SHMCBSubcache structure has a fixed size (header->subcache_size), + * which is determined at creation time, and looks like the following: + * + * [ SHMCBSubcache | Indexes | Data ] + * + * Each subcache is prefixed by the SHMCBSubcache structure. + * + * The subcache's "Data" segment is a single cyclic data buffer, of + * total size header->subcache_data_size; data inside is referenced + * using byte offsets. The offset marking the beginning of the cyclic + * buffer is subcache->data_pos the buffer's length is + * subcache->data_used. + * + * "Indexes" is an array of header->index_num SHMCBIndex structures, + * which is used as a cyclic queue; subcache->idx_pos gives the array + * index of the first in use, subcache->idx_used gives the number in + * use. Both ->idx_* values have a range of [0, header->index_num) + * + * Each in-use SHMCBIndex structure represents a single SSL session. + */ + /* This macro takes a pointer to the header and a zero-based index and returns * a pointer to the corresponding subcache. */ #define SHMCB_SUBCACHE(pHeader, num) \ -- 2.40.0