- Timestamp:
- Sep 23, 2010, 3:35:27 AM (12 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, master, msva, proxy-ticket, upstream
- Children:
- d8c7cf4
- Parents:
- 0fce7c2
- git-author:
- Nikos Mavrogiannopoulos <nmav@…> (09/23/10 03:27:03)
- git-committer:
- Nikos Mavrogiannopoulos <nmav@…> (09/23/10 03:35:27)
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
r0fce7c2 r771ca63 36 36 /* it seems the default has some strange errors. Use SDBM 37 37 */ 38 #define ODB "SDBM"39 40 38 #define MC_TAG "mod_gnutls:" 41 39 #define MC_TAG_LEN sizeof(MC_TAG) … … 297 295 #endif /* have_apr_memcache */ 298 296 297 const char* db_type(mgs_srvconf_rec * sc) 298 { 299 if (sc->cache_type == mgs_cache_sdbm) 300 return "sdbm"; 301 else 302 return "default"; 303 } 304 299 305 #define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD ) 300 306 … … 322 328 deleted = 0; 323 329 324 rv = apr_dbm_open_ex(&dbm, ODB, ctxt->sc->cache_config, APR_DBM_RWCREATE,330 rv = apr_dbm_open_ex(&dbm, db_type(ctxt->sc), ctxt->sc->cache_config, APR_DBM_RWCREATE, 325 331 SSL_DBM_FILE_MODE, spool); 326 332 if (rv != APR_SUCCESS) { … … 375 381 return data; 376 382 377 rv = apr_dbm_open_ex(&dbm, ODB, ctxt->sc->cache_config,383 rv = apr_dbm_open_ex(&dbm, db_type(ctxt->sc), ctxt->sc->cache_config, 378 384 APR_DBM_READONLY, SSL_DBM_FILE_MODE, ctxt->c->pool); 379 385 if (rv != APR_SUCCESS) { … … 445 451 data.data, data.size); 446 452 447 rv = apr_dbm_open_ex(&dbm, ODB, ctxt->sc->cache_config,453 rv = apr_dbm_open_ex(&dbm, db_type(ctxt->sc), ctxt->sc->cache_config, 448 454 APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, ctxt->c->pool); 449 455 if (rv != APR_SUCCESS) { … … 485 491 return -1; 486 492 487 rv = apr_dbm_open_ex(&dbm, ODB, ctxt->sc->cache_config,493 rv = apr_dbm_open_ex(&dbm, db_type(ctxt->sc), ctxt->sc->cache_config, 488 494 APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, ctxt->c->pool); 489 495 if (rv != APR_SUCCESS) { … … 519 525 const char* path2; 520 526 521 rv = apr_dbm_open_ex(&dbm, ODB, sc->cache_config, APR_DBM_RWCREATE,527 rv = apr_dbm_open_ex(&dbm, db_type(sc), sc->cache_config, APR_DBM_RWCREATE, 522 528 SSL_DBM_FILE_MODE, p); 523 529 … … 531 537 apr_dbm_close(dbm); 532 538 533 apr_dbm_get_usednames_ex(p, ODB, sc->cache_config, &path1, &path2);539 apr_dbm_get_usednames_ex(p, db_type(sc), sc->cache_config, &path1, &path2); 534 540 535 541 /* The Following Code takes logic directly from mod_ssl's DBM Cache */ … … 550 556 mgs_srvconf_rec *sc) 551 557 { 552 if (sc->cache_type == mgs_cache_dbm ) {558 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) { 553 559 return dbm_cache_post_config(p, s, sc); 554 560 } … … 559 565 mgs_srvconf_rec *sc) 560 566 { 561 if (sc->cache_type == mgs_cache_dbm ) {567 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) { 562 568 return 0; 563 569 } … … 574 580 int mgs_cache_session_init(mgs_handle_t *ctxt) 575 581 { 576 if (ctxt->sc->cache_type == mgs_cache_dbm ) {582 if (ctxt->sc->cache_type == mgs_cache_dbm || ctxt->sc->cache_type == mgs_cache_sdbm) { 577 583 gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch); 578 584 gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete); -
src/gnutls_config.c
r0fce7c2 r771ca63 344 344 } 345 345 346 sc->cache_type = mgs_cache_none; 347 if (strcasecmp("dbm", type) == 0) { 346 if (strcasecmp("none", type) == 0) { 347 sc->cache_type = mgs_cache_none; 348 } else if (strcasecmp("dbm", type) == 0) { 348 349 sc->cache_type = mgs_cache_dbm; 350 } 351 else if (strcasecmp("sdbm", type) == 0) { 352 sc->cache_type = mgs_cache_sdbm; 349 353 } 350 354 #if HAVE_APR_MEMCACHE … … 357 361 } 358 362 359 if (sc->cache_type == mgs_cache_dbm ) {363 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) { 360 364 sc->cache_config = ap_server_root_relative(parms->pool, arg); 361 365 } else {
Note: See TracChangeset
for help on using the changeset viewer.