Changeset ded2291 in mod_gnutls for src/gnutls_cache.c


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.c

    r6bbd378 rded2291  
    112112
    113113
    114 static int socache_store(server_rec *server, gnutls_datum_t key,
    115                          gnutls_datum_t data, apr_time_t expiry)
     114int mgs_cache_store(mgs_cache_t cache __attribute__((unused)),
     115                    server_rec *server, gnutls_datum_t key,
     116                    gnutls_datum_t data, apr_time_t expiry)
    116117{
    117118    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
     
    161162    apr_time_t expiry = apr_time_now() + ctxt->sc->cache_timeout;
    162163
    163     return socache_store(ctxt->c->base_server, dbmkey, data, expiry);
     164    return mgs_cache_store(ctxt->sc->cache, ctxt->c->base_server,
     165                           dbmkey, data, expiry);
    164166}
    165167
     
    168170// 4K should be enough for OCSP responses and sessions alike
    169171#define SOCACHE_FETCH_BUF_SIZE 4096
    170 static gnutls_datum_t socache_fetch(server_rec *server, gnutls_datum_t key,
    171                                     apr_pool_t *pool)
     172gnutls_datum_t mgs_cache_fetch(mgs_cache_t cache __attribute__((unused)),
     173                               server_rec *server, gnutls_datum_t key,
     174                               apr_pool_t *pool)
    172175{
    173176    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
     
    228231        return data;
    229232
    230     return socache_fetch(ctxt->c->base_server, dbmkey, ctxt->c->pool);
     233    return mgs_cache_fetch(ctxt->sc->cache, ctxt->c->base_server,
     234                           dbmkey, ctxt->c->pool);
    231235}
    232236
     
    310314    else if (sc->cache_type == mgs_cache_shmcb)
    311315        pname = "shmcb";
    312 
    313     sc->cache->store = socache_store;
    314     sc->cache->fetch = socache_fetch;
    315316
    316317    /* Find the right socache provider */
Note: See TracChangeset for help on using the changeset viewer.