Changeset f785704 in mod_gnutls
- Timestamp:
- Jun 5, 2016, 3:42:31 PM (5 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
- Children:
- ae08186
- Parents:
- 04e6e65
- git-author:
- Thomas Klute <thomas2.klute@…> (06/04/16 19:57:24)
- git-committer:
- Thomas Klute <thomas2.klute@…> (06/05/16 15:42:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
r04e6e65 rf785704 309 309 #define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD ) 310 310 311 static void dbm_cache_expire(mgs_handle_t * ctxt) { 311 static void dbm_cache_expire(server_rec *s) 312 { 313 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 314 ap_get_module_config(s->module_config, &gnutls_module); 315 312 316 apr_status_t rv; 313 317 apr_dbm_t *dbm; 314 318 apr_datum_t dbmkey; 315 319 apr_datum_t dbmval; 316 apr_time_t now;317 320 apr_time_t dtime; 318 321 apr_pool_t *spool; 319 322 int total, deleted; 320 323 321 now = apr_time_now(); 322 323 if (now - ctxt->sc->last_cache_check < 324 (ctxt->sc->cache_timeout) / 2) 324 apr_time_t now = apr_time_now(); 325 326 if (now - sc->last_cache_check < (sc->cache_timeout) / 2) 325 327 return; 326 328 327 ctxt->sc->last_cache_check = now;328 329 apr_pool_create(&spool, ctxt->c->pool);329 sc->last_cache_check = now; 330 331 apr_pool_create(&spool, NULL); 330 332 331 333 total = 0; 332 334 deleted = 0; 333 335 334 rv = apr_dbm_open_ex(&dbm, db_type( ctxt->sc),335 ctxt->sc->cache_config, APR_DBM_RWCREATE,336 rv = apr_dbm_open_ex(&dbm, db_type(sc), 337 sc->cache_config, APR_DBM_RWCREATE, 336 338 SSL_DBM_FILE_MODE, spool); 337 339 if (rv != APR_SUCCESS) { 338 ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, 339 ctxt->c->base_server, 340 ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, s, 340 341 "[gnutls_cache] error opening cache searcher '%s'", 341 ctxt->sc->cache_config);342 sc->cache_config); 342 343 apr_pool_destroy(spool); 343 344 return; … … 365 366 apr_dbm_close(dbm); 366 367 367 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, 368 ctxt->c->base_server, 368 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s, 369 369 "[gnutls_cache] Cleaned up cache '%s'. Deleted %d and left %d", 370 ctxt->sc->cache_config, deleted, total - deleted);370 sc->cache_config, deleted, total - deleted); 371 371 372 372 apr_pool_destroy(spool); … … 442 442 /* we expire dbm only on every store 443 443 */ 444 dbm_cache_expire(ctxt );444 dbm_cache_expire(ctxt->c->base_server); 445 445 446 446 apr_pool_create(&spool, ctxt->c->pool);
Note: See TracChangeset
for help on using the changeset viewer.