Changeset 1d1361f 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:
- 15245bf
- Parents:
- ae08186
- git-author:
- Thomas Klute <thomas2.klute@…> (06/04/16 21:08:56)
- git-committer:
- Thomas Klute <thomas2.klute@…> (06/05/16 15:42:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
rae08186 r1d1361f 427 427 } 428 428 429 static int dbm_cache_store( void *baton, apr_datum_t key,429 static int dbm_cache_store(server_rec *s, apr_datum_t key, 430 430 gnutls_datum_t data, apr_time_t expiry) 431 431 { 432 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 433 ap_get_module_config(s->module_config, &gnutls_module); 434 432 435 apr_dbm_t *dbm; 433 436 apr_datum_t dbmval; 434 mgs_handle_t *ctxt = baton;435 437 apr_status_t rv; 436 438 apr_pool_t *spool; 437 439 438 /* we expire dbm only on every store 439 */ 440 dbm_cache_expire(ctxt->c->base_server); 441 442 apr_pool_create(&spool, ctxt->c->pool); 440 /* we expire dbm only on every store */ 441 dbm_cache_expire(s); 442 443 apr_pool_create(&spool, NULL); 443 444 444 445 /* create DBM value */ … … 451 452 data.data, data.size); 452 453 453 rv = apr_dbm_open_ex(&dbm, db_type( ctxt->sc),454 ctxt->sc->cache_config, APR_DBM_RWCREATE,455 SSL_DBM_FILE_MODE, ctxt->c->pool);456 if (rv != APR_SUCCESS) {457 ap_log_error(APLOG_MARK, APLOG_NOTICE, rv,458 ctxt->c->base_server,459 "[gnutls_cache]error opening cache '%s'",460 ctxt->sc->cache_config);454 rv = apr_dbm_open_ex(&dbm, db_type(sc), 455 sc->cache_config, APR_DBM_RWCREATE, 456 SSL_DBM_FILE_MODE, spool); 457 if (rv != APR_SUCCESS) 458 { 459 ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, s, 460 "error opening cache '%s'", 461 sc->cache_config); 461 462 apr_pool_destroy(spool); 462 463 return -1; … … 464 465 465 466 rv = apr_dbm_store(dbm, key, dbmval); 466 467 if (rv != APR_SUCCESS) { 468 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, 469 ctxt->c->base_server, 470 "[gnutls_cache] error storing in cache '%s'", 471 ctxt->sc->cache_config); 467 if (rv != APR_SUCCESS) 468 { 469 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s, 470 "error storing in cache '%s'", 471 sc->cache_config); 472 472 apr_dbm_close(dbm); 473 473 apr_pool_destroy(spool); 474 474 return -1; 475 475 } 476 477 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, s, 478 "stored %ld bytes of data (%ld byte key) in cache '%s'", 479 dbmval.dsize, key.dsize, sc->cache_config); 476 480 477 481 apr_dbm_close(dbm); … … 493 497 apr_time_t expiry = apr_time_now() + ctxt->sc->cache_timeout; 494 498 495 return dbm_cache_store( baton, dbmkey, data, expiry);499 return dbm_cache_store(ctxt->c->base_server, dbmkey, data, expiry); 496 500 } 497 501
Note: See TracChangeset
for help on using the changeset viewer.