Changeset 14548b9 in mod_gnutls for src/gnutls_cache.h
- Timestamp:
- Dec 5, 2016, 4:02:30 PM (4 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
- Children:
- 104e881
- Parents:
- d4d066f
- git-author:
- Thomas Klute <thomas2.klute@…> (12/05/16 16:01:23)
- git-committer:
- Thomas Klute <thomas2.klute@…> (12/05/16 16:02:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.h
rd4d066f r14548b9 1 /* *1 /* 2 2 * Copyright 2004-2005 Paul Querna 3 3 * Copyright 2014 Nikos Mavrogiannopoulos … … 15 15 * See the License for the specific language governing permissions and 16 16 * limitations under the License. 17 */ 18 19 /** 20 * @file 17 21 * 22 * Generic object cache for mod_gnutls 18 23 */ 19 24 … … 24 29 #include <httpd.h> 25 30 31 /** Name of the mod_gnutls cache access mutex, for use with Apache's 32 * `Mutex` directive */ 26 33 #define MGS_CACHE_MUTEX_NAME "gnutls-cache" 27 34 28 35 /** 29 * Init the Cache after Configuration is done 36 * Initialize the internal cache configuration structure. This 37 * function is called after the configuration file(s) have been 38 * parsed. 30 39 */ 31 40 int mgs_cache_post_config(apr_pool_t *p, server_rec *s, mgs_srvconf_rec *sc); 32 41 33 42 /** 34 * Init the Cache inside each Process43 * (Re-)Initialize the cache in a child process after forking 35 44 */ 36 45 int mgs_cache_child_init(apr_pool_t *p, server_rec *s, mgs_srvconf_rec *sc); 37 46 38 47 /** 39 * Setup the Session Caching 48 * Setup caching for the given TLS session 49 * 50 * @param ctxt mod_gnutls session context 51 * @return 0 40 52 */ 41 53 int mgs_cache_session_init(mgs_handle_t *ctxt); … … 44 56 45 57 /** 46 * Convert a time_tinto a null terminated string in a format47 * compatible with OpenSSL's ASN1_TIME_print()58 * Convert a `time_t` into a null terminated string in a format 59 * compatible with OpenSSL's `ASN1_TIME_print()` 48 60 * 49 61 * @param t time_t time 50 62 * @param str Location to store the time string 51 * @param strsize The maximum length that can be stored in str 63 * @param strsize The maximum length that can be stored in `str` 64 * @return `str` 52 65 */ 53 66 char *mgs_time2sz(time_t t, char *str, int strsize); 54 67 55 /* 56 * Generic object cache functions, used for OCSP caching 68 /** 69 * Generic store function for the mod_gnutls object cache 70 * 71 * @param s server associated with the cache entry 72 * @param key key for the cache entry 73 * @param data data to be cached 74 * @param expiry expiration time 75 * @return -1 on error, 0 on success 57 76 */ 58 77 typedef int (*cache_store_func)(server_rec *s, gnutls_datum_t key, 59 78 gnutls_datum_t data, apr_time_t expiry); 79 /** 80 * Generic fetch function for the mod_gnutls object cache 81 * 82 * @param ctxt mod_gnutls session context for the request 83 * @param key key for the cache entry to be fetched 84 * @return the requested cache entry, or `{NULL, 0}` 85 */ 60 86 typedef gnutls_datum_t (*cache_fetch_func)(mgs_handle_t *ctxt, 61 87 gnutls_datum_t key); 88 /** 89 * Internal cache configuration structure 90 */ 62 91 struct mgs_cache { 92 /** Store function for this cache */ 63 93 cache_store_func store; 94 /** Fetch function for this cache */ 64 95 cache_fetch_func fetch; 65 /* Mutex for cache access (used only if the cache type is not96 /** Mutex for cache access (used only if the cache type is not 66 97 * thread-safe) */ 67 98 apr_global_mutex_t *mutex;
Note: See TracChangeset
for help on using the changeset viewer.