Changeset ae08186 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:
- 1d1361f
- Parents:
- f785704
- git-author:
- Thomas Klute <thomas2.klute@…> (06/04/16 20:28:38)
- git-committer:
- Thomas Klute <thomas2.klute@…> (06/05/16 15:42:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
rf785704 rae08186 427 427 } 428 428 429 static int dbm_cache_store(void *baton, gnutls_datum_t key, 430 gnutls_datum_t data) { 429 static int dbm_cache_store(void *baton, apr_datum_t key, 430 gnutls_datum_t data, apr_time_t expiry) 431 { 431 432 apr_dbm_t *dbm; 432 apr_datum_t dbmkey;433 433 apr_datum_t dbmval; 434 434 mgs_handle_t *ctxt = baton; 435 435 apr_status_t rv; 436 apr_time_t expiry;437 436 apr_pool_t *spool; 438 439 if (mgs_session_id2dbm(ctxt->c, key.data, key.size, &dbmkey) < 0)440 return -1;441 437 442 438 /* we expire dbm only on every store … … 450 446 dbmval.dptr = (char *) apr_palloc(spool, dbmval.dsize); 451 447 452 expiry = apr_time_now() + ctxt->sc->cache_timeout; 453 448 /* prepend expiration time */ 454 449 memcpy((char *) dbmval.dptr, &expiry, sizeof (apr_time_t)); 455 450 memcpy((char *) dbmval.dptr + sizeof (apr_time_t), … … 468 463 } 469 464 470 rv = apr_dbm_store(dbm, dbmkey, dbmval);465 rv = apr_dbm_store(dbm, key, dbmval); 471 466 472 467 if (rv != APR_SUCCESS) { … … 485 480 486 481 return 0; 482 } 483 484 static int dbm_cache_store_session(void *baton, gnutls_datum_t key, 485 gnutls_datum_t data) 486 { 487 mgs_handle_t *ctxt = baton; 488 apr_datum_t dbmkey; 489 490 if (mgs_session_id2dbm(ctxt->c, key.data, key.size, &dbmkey) < 0) 491 return -1; 492 493 apr_time_t expiry = apr_time_now() + ctxt->sc->cache_timeout; 494 495 return dbm_cache_store(baton, dbmkey, data, expiry); 487 496 } 488 497 … … 614 623 dbm_cache_delete); 615 624 gnutls_db_set_store_function(ctxt->session, 616 dbm_cache_store );625 dbm_cache_store_session); 617 626 gnutls_db_set_ptr(ctxt->session, ctxt); 618 627 }
Note: See TracChangeset
for help on using the changeset viewer.