Changeset ded2291 in mod_gnutls for src/gnutls_cache.h


Ignore:
Timestamp:
Apr 24, 2018, 1:13:28 PM (3 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master, master, proxy-ticket
Children:
41f9bcb
Parents:
6bbd378
Message:

Switch generic cache store/fetch function pointers to constant functions

Using socache takes care of the different cache types, so this layer
of abstraction is no longer needed. Add a currently unused mgs_cache_t
parameter to allow for multiple mod_gnutls caches in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.h

    r6bbd378 rded2291  
    8282
    8383/**
    84  * Generic store function for the mod_gnutls object cache.
     84 * Store function for the mod_gnutls object caches.
    8585 *
     86 * @param cache the cache to store the entry in
    8687 * @param s server associated with the cache entry
    8788 * @param key key for the cache entry
     
    9192 * @return `-1` on error, `0` on success
    9293 */
    93 typedef int (*cache_store_func)(server_rec *s, gnutls_datum_t key,
    94                                 gnutls_datum_t data, apr_time_t expiry);
     94int mgs_cache_store(mgs_cache_t cache, server_rec *server, gnutls_datum_t key,
     95                    gnutls_datum_t data, apr_time_t expiry);
     96
    9597/**
    96  * Generic fetch function for the mod_gnutls object cache.
     98 * Fetch function for the mod_gnutls object caches.
    9799 *
    98100 * *Warning*: The `data` element of the returned `gnutls_datum_t` is
    99101 * allocated using `gnutls_malloc()` for compatibility with the GnuTLS
    100102 * session caching API, and must be released using `gnutls_free()`.
     103 *
     104 * @param cache the cache to fetch from
    101105 *
    102106 * @param server server context for the request
     
    109113 * @return the requested cache entry, or `{NULL, 0}`
    110114 */
    111 typedef gnutls_datum_t (*cache_fetch_func)(server_rec *server,
    112                                            gnutls_datum_t key,
    113                                            apr_pool_t *pool);
     115gnutls_datum_t mgs_cache_fetch(mgs_cache_t cache, server_rec *server,
     116                               gnutls_datum_t key, apr_pool_t *pool);
     117
    114118/**
    115119 * Internal cache configuration structure
     
    120124    /** The actual socache instance */
    121125    ap_socache_instance_t *socache;
    122     /** Store function for this cache */
    123     cache_store_func store;
    124     /** Fetch function for this cache */
    125     cache_fetch_func fetch;
    126126    /** Mutex for cache access (used only if the cache type is not
    127127     * thread-safe) */
Note: See TracChangeset for help on using the changeset viewer.