- Timestamp:
- Apr 29, 2018, 6:33:34 AM (3 years ago)
- Branches:
- asyncio, debian/master, master, proxy-ticket
- Children:
- f52f1b4
- Parents:
- a314ec9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
ra314ec9 rd8d6b1e 165 165 166 166 167 // 4K should be enough for OCSP responses and sessions alike 168 #define SOCACHE_FETCH_BUF_SIZE 4096 167 /** 8K is the maximum size accepted when receiving OCSP responses, 168 * sessions cache entries should be much smaller. The buffer is 169 * reallocated to actual size after fetching, so memory waste is 170 * minimal and temporary. */ 171 #define SOCACHE_FETCH_BUF_SIZE (8 * 1024) 172 169 173 gnutls_datum_t mgs_cache_fetch(mgs_cache_t cache, server_rec *server, 170 174 gnutls_datum_t key, apr_pool_t *pool) … … 212 216 "fetched %u bytes from cache '%s:%s'", 213 217 data.size, cache->prov->name, sc->cache->config); 218 219 /* Realloc buffer to data.size. Data size must be less than or 220 * equal to the initial buffer size, so this REALLY should not 221 * fail. */ 222 data.data = gnutls_realloc(data.data, data.size); 223 if (__builtin_expect(data.data == NULL, 0)) 224 { 225 ap_log_error(APLOG_MARK, APLOG_CRIT, APR_ENOMEM, server, 226 "%s: Could not realloc fetch buffer to data size!", 227 __func__); 228 data.size = 0; 229 } 214 230 } 215 231 apr_pool_destroy(spool);
Note: See TracChangeset
for help on using the changeset viewer.