Changeset b94aee2 in mod_gnutls for src/gnutls_config.c


Ignore:
Timestamp:
Apr 28, 2018, 5:52:56 PM (3 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master, master, proxy-ticket
Children:
a314ec9
Parents:
2f949bc
Message:

Remove internal cache type enum

The cache type is now transparently passed to ap_lookup_provider(), so
mod_gnutls does not need to manage available cache types. The new
server variable sc->cache_enable exists to track whether the cache
should be used at all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r2f949bc rb94aee2  
    594594    if (strcasecmp("none", type) == 0)
    595595    {
    596         sc->cache_type = mgs_cache_none;
     596        sc->cache_enable = GNUTLS_ENABLED_FALSE;
     597        sc->cache_type = NULL;
    597598        sc->cache_config = NULL;
    598599        return NULL;
    599600    }
     601
     602    sc->cache_enable = GNUTLS_ENABLED_TRUE;
    600603
    601604    /* Try to split socache "type:config" style configuration */
     
    603606    if (sep)
    604607    {
    605         type = apr_pstrmemdup(parms->temp_pool, type, sep - type);
     608        sc->cache_type = apr_pstrmemdup(parms->pool, type, sep - type);
    606609        if (arg != NULL)
    607610        {
     
    612615        arg = ++sep;
    613616    }
    614 
    615     if (strcasecmp("dbm", type) == 0) {
    616         sc->cache_type = mgs_cache_dbm;
    617     } else if (strcasecmp("gdbm", type) == 0) {
    618         sc->cache_type = mgs_cache_gdbm;
    619     }
    620     else if (strcasecmp("memcache", type) == 0) {
    621         sc->cache_type = mgs_cache_memcache;
    622     }
    623     else if (strcasecmp("shmcb", type) == 0) {
    624         sc->cache_type = mgs_cache_shmcb;
    625     }
    626     else {
    627         return "Invalid Type for GnuTLSCache!";
    628     }
     617    else
     618        sc->cache_type = apr_pstrdup(parms->pool, type);
    629619
    630620    if (arg == NULL)
    631         return "Invalid argument 2 for GnuTLSCache!";
    632 
    633     if (sc->cache_type == mgs_cache_dbm
    634         || sc->cache_type == mgs_cache_gdbm) {
    635         sc->cache_config = ap_server_root_relative(parms->pool, arg);
    636     } else {
     621        sc->cache_config = "";
     622    else
    637623        sc->cache_config = apr_pstrdup(parms->pool, arg);
    638     }
    639624
    640625    return NULL;
     
    880865    sc->priorities_str = NULL;
    881866    sc->cache_timeout = MGS_TIMEOUT_UNSET;
    882     sc->cache_type = mgs_cache_unset;
     867    sc->cache_type = NULL;
     868    sc->cache_enable = GNUTLS_ENABLED_UNSET;
    883869    sc->cache_config = NULL;
    884870    sc->cache = NULL;
Note: See TracChangeset for help on using the changeset viewer.