Changeset c34a68b in mod_gnutls
- Timestamp:
- Apr 19, 2018, 2:50:49 PM (3 years ago)
- Branches:
- asyncio, debian/master, master, proxy-ticket
- Children:
- a85de63
- Parents:
- 3656df0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
r3656df0 rc34a68b 456 456 static gnutls_datum_t dbm_cache_fetch(mgs_handle_t *ctxt, gnutls_datum_t key) 457 457 { 458 server_rec *server = ctxt->c->base_server; 459 apr_pool_t *pool = ctxt->c->pool; 460 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 461 ap_get_module_config(server->module_config, &gnutls_module); 462 458 463 gnutls_datum_t data = {NULL, 0}; 459 464 apr_dbm_t *dbm; … … 464 469 465 470 /* check if it is time for cache expiration */ 466 dbm_cache_expire( ctxt->c->base_server);467 468 apr_global_mutex_lock( ctxt->sc->cache->mutex);469 470 rv = apr_dbm_open_ex(&dbm, db_type( ctxt->sc),471 ctxt->sc->cache_config, APR_DBM_READONLY,472 SSL_DBM_FILE_MODE, ctxt->c->pool);471 dbm_cache_expire(server); 472 473 apr_global_mutex_lock(sc->cache->mutex); 474 475 rv = apr_dbm_open_ex(&dbm, db_type(sc), 476 sc->cache_config, APR_DBM_READONLY, 477 SSL_DBM_FILE_MODE, pool); 473 478 if (rv != APR_SUCCESS) { 474 ap_log_ cerror(APLOG_MARK, APLOG_NOTICE, rv, ctxt->c,475 476 ctxt->sc->cache_config);477 apr_global_mutex_unlock( ctxt->sc->cache->mutex);479 ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, server, 480 "error opening cache '%s'", 481 sc->cache_config); 482 apr_global_mutex_unlock(sc->cache->mutex); 478 483 return data; 479 484 } … … 498 503 } 499 504 500 ap_log_ cerror(APLOG_MARK, APLOG_TRACE1, rv, ctxt->c,501 502 505 ap_log_error(APLOG_MARK, APLOG_TRACE1, rv, server, 506 "fetched %" APR_SIZE_T_FMT " bytes from cache", 507 dbmval.dsize); 503 508 504 509 memcpy(data.data, dbmval.dptr + sizeof (apr_time_t), data.size); … … 508 513 close_db: 509 514 apr_dbm_close(dbm); 510 apr_global_mutex_unlock( ctxt->sc->cache->mutex);515 apr_global_mutex_unlock(sc->cache->mutex); 511 516 512 517 /* cache entry might have expired since last cache cleanup */ … … 516 521 data.data = NULL; 517 522 data.size = 0; 518 ap_log_ cerror(APLOG_MARK, APLOG_TRACE1, APR_SUCCESS, ctxt->c,519 523 ap_log_error(APLOG_MARK, APLOG_TRACE1, APR_SUCCESS, server, 524 "dropped expired cache data"); 520 525 } 521 526
Note: See TracChangeset
for help on using the changeset viewer.