- Timestamp:
- Jan 11, 2013, 12:58:18 AM (8 years ago)
- Branches:
- debian/master, debian/stretch-backports, jessie-backports
- Children:
- 2b1118c
- Parents:
- 9c4a744 (diff), 17eb1a1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
r9c4a744 r619c6bf 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_gdbm) 300 return "gdbm"; 301 else 302 return "db"; 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_gdbm) { 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_gdbm) { 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_gdbm) { 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
r9c4a744 r619c6bf 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("gdbm", type) == 0) { 352 sc->cache_type = mgs_cache_gdbm; 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_gdbm) { 360 364 sc->cache_config = ap_server_root_relative(parms->pool, arg); 361 365 } else { -
src/gnutls_io.c
r9c4a744 r619c6bf 556 556 apr_bucket *bucket = APR_BRIGADE_FIRST(bb); 557 557 558 if (AP_BUCKET_IS_EOC(bucket) || APR_BUCKET_IS_EOS(bucket)) { 559 apr_bucket_brigade * tmpb; 560 561 if (APR_BUCKET_IS_EOS(bucket)) { 562 tmpb = bb; 563 } else { 564 tmpb = ctxt->output_bb; 565 } 566 558 if (AP_BUCKET_IS_EOC(bucket)) { 567 559 if (ctxt->session != NULL) { 568 560 do { … … 574 566 APR_BRIGADE_INSERT_TAIL(ctxt->output_bb, e); 575 567 576 if ((status = ap_pass_brigade(f->next, tmpb)) != APR_SUCCESS) {568 if ((status = ap_pass_brigade(f->next, ctxt->output_bb)) != APR_SUCCESS) { 577 569 apr_brigade_cleanup(ctxt->output_bb); 578 570 return status; … … 585 577 } 586 578 continue; 587 } else if (APR_BUCKET_IS_FLUSH(bucket) ) {579 } else if (APR_BUCKET_IS_FLUSH(bucket) || APR_BUCKET_IS_EOS(bucket)) { 588 580 589 581 apr_bucket_copy(bucket, &e);
Note: See TracChangeset
for help on using the changeset viewer.