Changeset 15245bf in mod_gnutls
- Timestamp:
- Jun 5, 2016, 3:42:31 PM (6 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
- Children:
- 6814e48
- Parents:
- 1d1361f
- git-author:
- Thomas Klute <thomas2.klute@…> (06/04/16 21:41:33)
- git-committer:
- Thomas Klute <thomas2.klute@…> (06/05/16 15:42:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
r1d1361f r15245bf 375 375 } 376 376 377 static gnutls_datum_t dbm_cache_fetch(void *baton, gnutls_datum_t key) { 377 static gnutls_datum_t dbm_cache_fetch(mgs_handle_t *ctxt, apr_datum_t key) 378 { 378 379 gnutls_datum_t data = {NULL, 0}; 379 380 apr_dbm_t *dbm; 380 apr_datum_t dbmkey;381 381 apr_datum_t dbmval; 382 mgs_handle_t *ctxt = baton;383 382 apr_status_t rv; 384 385 if (mgs_session_id2dbm(ctxt->c, key.data, key.size, &dbmkey) < 0)386 return data;387 383 388 384 rv = apr_dbm_open_ex(&dbm, db_type(ctxt->sc), … … 390 386 SSL_DBM_FILE_MODE, ctxt->c->pool); 391 387 if (rv != APR_SUCCESS) { 392 ap_log_error(APLOG_MARK, APLOG_NOTICE, rv, 393 ctxt->c->base_server, 394 "[gnutls_cache] error opening cache '%s'", 395 ctxt->sc->cache_config); 396 return data; 397 } 398 399 rv = apr_dbm_fetch(dbm, dbmkey, &dbmval); 388 ap_log_cerror(APLOG_MARK, APLOG_NOTICE, rv, ctxt->c, 389 "error opening cache '%s'", 390 ctxt->sc->cache_config); 391 return data; 392 } 393 394 rv = apr_dbm_fetch(dbm, key, &dbmval); 400 395 401 396 if (rv != APR_SUCCESS) { … … 419 414 } 420 415 416 ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, ctxt->c, 417 "fetched %ld bytes from cache", 418 dbmval.dsize); 419 421 420 memcpy(data.data, dbmval.dptr + sizeof (apr_time_t), data.size); 422 421 … … 425 424 426 425 return data; 426 } 427 428 static gnutls_datum_t dbm_cache_fetch_session(void *baton, 429 gnutls_datum_t key) 430 { 431 gnutls_datum_t data = {NULL, 0}; 432 apr_datum_t dbmkey; 433 mgs_handle_t *ctxt = baton; 434 435 if (mgs_session_id2dbm(ctxt->c, key.data, key.size, &dbmkey) < 0) 436 return data; 437 438 return dbm_cache_fetch(ctxt, dbmkey); 427 439 } 428 440 … … 623 635 || ctxt->sc->cache_type == mgs_cache_gdbm) { 624 636 gnutls_db_set_retrieve_function(ctxt->session, 625 dbm_cache_fetch );637 dbm_cache_fetch_session); 626 638 gnutls_db_set_remove_function(ctxt->session, 627 639 dbm_cache_delete);
Note: See TracChangeset
for help on using the changeset viewer.