Changeset 3358887 in mod_gnutls


Ignore:
Timestamp:
May 30, 2018, 2:12:49 AM (2 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
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.

Location:
src
Files:
2 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;
  • src/gnutls_cache.h

    reced11a r3358887  
    4343 * is supposed to happen during post_config.
    4444 *
    45  * @param cache pointer to the mgs_cache_t, memory will be allocated
    46  * if currently NULL.
     45 * @param cache pointer to the mgs_cache_t, will be assigned only if
     46 * configuration succeeds
    4747 *
    4848 * @param server associated server for logging purposes
     
    5353 * `NULL` if the provider accepts an empty configuration
    5454 *
    55  * @param pconf configuration memory pool
     55 * @param pconf configuration memory pool, used to store cache
     56 * configuration
    5657 *
    5758 * @param ptemp temporary memory pool
Note: See TracChangeset for help on using the changeset viewer.