Changeset 3358887 in mod_gnutls for src/gnutls_cache.c


Ignore:
Timestamp:
May 30, 2018, 2:12:49 AM (3 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, debian/master, master, proxy-ticket
Children:
994200a
Parents:
eced11a
git-author:
Fiona Klute <fiona.klute@…> (05/30/18 01:43:09)
git-committer:
Fiona Klute <fiona.klute@…> (05/30/18 02:12:49)
Message:

Assign cache configuration to server only if successful

The sc->cache or sc->ocsp_cache will remain NULL if the requested
provider cannot be set up. This is important for the planned default
OCSP cache configuration because checks for sc->ocsp_cache == NULL
will still work if the default configuration cannot be applied.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    reced11a r3358887  
    314314                                  apr_pool_t *pconf, apr_pool_t *ptemp)
    315315{
    316     /* allocate cache structure if needed */
    317     if (*cache == NULL)
    318     {
    319         *cache = apr_pcalloc(pconf, sizeof(struct mgs_cache));
    320         if (*cache == NULL)
    321             return "Could not allocate memory for cache configuration!";
    322     }
    323     mgs_cache_t c = *cache;
     316    /* Allocate cache structure, will be assigned to *cache after
     317     * successful configuration. */
     318    mgs_cache_t c = apr_pcalloc(pconf, sizeof(struct mgs_cache));
     319    if (c == NULL)
     320        return "Could not allocate memory for cache configuration!";
    324321
    325322    /* Find the right socache provider */
     
    355352                 "%s: Socache '%s:%s' created.",
    356353                 __func__, c->prov->name, c->config);
     354
     355    /* assign configured cache structure to server */
     356    *cache = c;
    357357
    358358    return NULL;
Note: See TracChangeset for help on using the changeset viewer.