Changeset babdb29 in mod_gnutls for src/gnutls_hooks.c


Ignore:
Timestamp:
May 16, 2018, 2:12:08 AM (2 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master, master, proxy-ticket
Children:
92b5f4d
Parents:
d036f96
Message:

Initialize and clean up the OCSP cache, following session cache patterns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    rd036f96 rbabdb29  
    130130    ap_mutex_register(pconf, MGS_CACHE_MUTEX_NAME, NULL, APR_LOCK_DEFAULT, 0);
    131131    ap_mutex_register(pconf, MGS_OCSP_MUTEX_NAME, NULL, APR_LOCK_DEFAULT, 0);
     132    ap_mutex_register(pconf, MGS_OCSP_CACHE_MUTEX_NAME, NULL,
     133                      APR_LOCK_DEFAULT, 0);
    132134
    133135    /* Register a pool clean-up function */
     
    633635        if (sc->cache_timeout == MGS_TIMEOUT_UNSET)
    634636            sc->cache_timeout = sc_base->cache_timeout;
     637        sc->ocsp_cache_enable = sc_base->ocsp_cache_enable;
     638        sc->ocsp_cache = sc_base->ocsp_cache;
    635639
    636640        sc->singleton_wd = sc_base->singleton_wd;
     
    775779    }
    776780
    777     if (sc->cache_enable) {
    778         rv = mgs_cache_child_init(p, s, sc);
    779         if (rv != APR_SUCCESS) {
     781    if (sc->cache_enable == GNUTLS_ENABLED_TRUE)
     782    {
     783        rv = mgs_cache_child_init(p, s, sc->cache, MGS_CACHE_MUTEX_NAME);
     784        if (rv != APR_SUCCESS)
    780785            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
    781                     "GnuTLS: Failed to run Cache Init");
    782         }
    783     }
    784 
    785     /* reinit OCSP mutex */
     786                    "Child init for session cache failed!");
     787    }
     788
     789    if (sc->ocsp_cache_enable == GNUTLS_ENABLED_TRUE)
     790    {
     791        rv = mgs_cache_child_init(p, s, sc->ocsp_cache,
     792                                  MGS_OCSP_CACHE_MUTEX_NAME);
     793        if (rv != APR_SUCCESS)
     794            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
     795                    "Child init for OCSP cache failed!");
     796    }
     797
     798    /* reinit OCSP request mutex */
    786799    const char *lockfile = apr_global_mutex_lockfile(sc->ocsp_mutex);
    787800    rv = apr_global_mutex_child_init(&sc->ocsp_mutex, lockfile, p);
Note: See TracChangeset for help on using the changeset viewer.