Changeset a85de63 in mod_gnutls for src/gnutls_cache.c


Ignore:
Timestamp:
Apr 19, 2018, 3:09:04 PM (3 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, debian/master, master, proxy-ticket
Children:
103cafa
Parents:
c34a68b
Message:

Make cache_fetch_func work without a connection context

This is necessary to do cache fetches without a client connection,
e.g. while doing asynchronous OCSP updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    rc34a68b ra85de63  
    33 *  Copyright 2008 Nikos Mavrogiannopoulos
    44 *  Copyright 2011 Dash Shendy
    5  *  Copyright 2015-2016 Fiona Klute
     5 *  Copyright 2015-2018 Fiona Klute
    66 *
    77 *  Licensed under the Apache License, Version 2.0 (the "License");
     
    326326}
    327327
    328 static gnutls_datum_t mc_cache_fetch_generic(mgs_handle_t *ctxt,
    329                                              gnutls_datum_t key)
     328static gnutls_datum_t mc_cache_fetch_generic(server_rec *server,
     329                                             gnutls_datum_t key,
     330                                             apr_pool_t *pool)
    330331{
    331332    gnutls_datum_t data = {NULL, 0};
    332     const char *hex = apr_pescape_hex(ctxt->c->pool, key.data, key.size, 1);
     333    const char *hex = apr_pescape_hex(pool, key.data, key.size, 1);
    333334    if (hex == NULL)
    334335        return data;
    335336
    336     const char *strkey = apr_psprintf(ctxt->c->pool, MC_TAG "%s", hex);
    337     return mc_cache_fetch(ctxt->c->base_server, strkey, ctxt->c->pool);
     337    const char *strkey = apr_psprintf(pool, MC_TAG "%s", hex);
     338    return mc_cache_fetch(server, strkey, pool);
    338339}
    339340
     
    454455}
    455456
    456 static gnutls_datum_t dbm_cache_fetch(mgs_handle_t *ctxt, gnutls_datum_t key)
    457 {
    458     server_rec *server = ctxt->c->base_server;
    459     apr_pool_t *pool = ctxt->c->pool;
     457
     458
     459static gnutls_datum_t dbm_cache_fetch(server_rec *server, gnutls_datum_t key,
     460                                      apr_pool_t *pool)
     461{
    460462    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
    461463        ap_get_module_config(server->module_config, &gnutls_module);
     
    537539        return data;
    538540
    539     return dbm_cache_fetch(ctxt, dbmkey);
     541    return dbm_cache_fetch(ctxt->c->base_server, dbmkey, ctxt->c->pool);
    540542}
    541543
Note: See TracChangeset for help on using the changeset viewer.