- Timestamp:
- Apr 22, 2018, 4:35:32 PM (3 years ago)
- Branches:
- asyncio, debian/master, master, proxy-ticket
- Children:
- de1ceab
- Parents:
- 7921dc7
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_config.c
r7921dc7 r0470e44 580 580 #endif 581 581 582 const char *mgs_set_cache(cmd_parms * parms, void *dummy __attribute__((unused)), 583 const char *type, const char *arg) { 582 const char *mgs_set_cache(cmd_parms * parms, 583 void *dummy __attribute__((unused)), 584 const char *type, const char *arg) 585 { 584 586 const char *err; 585 587 mgs_srvconf_rec *sc = 586 ap_get_module_config(parms->server->module_config, 587 &gnutls_module); 588 if ((err = ap_check_cmd_context(parms, GLOBAL_ONLY))) { 589 return err; 590 } 591 592 if (strcasecmp("none", type) == 0) { 593 sc->cache_type = mgs_cache_none; 594 sc->cache_config = NULL; 595 return NULL; 596 } else if (strcasecmp("dbm", type) == 0) { 597 sc->cache_type = mgs_cache_dbm; 588 ap_get_module_config(parms->server->module_config, 589 &gnutls_module); 590 if ((err = ap_check_cmd_context(parms, GLOBAL_ONLY))) 591 return err; 592 593 /* none: disable cache */ 594 if (strcasecmp("none", type) == 0) 595 { 596 sc->cache_type = mgs_cache_none; 597 sc->cache_config = NULL; 598 return NULL; 599 } 600 601 /* Try to split socache "type:config" style configuration */ 602 const char* sep = ap_strchr_c(type, ':'); 603 if (sep) 604 { 605 type = apr_pstrmemdup(parms->temp_pool, type, sep - type); 606 if (arg != NULL) 607 { 608 /* No mixing of socache style and legacy config! */ 609 return "GnuTLSCache appears to have a mod_socache style " 610 "type:config value, but there is a second parameter!"; 611 } 612 arg = ++sep; 613 } 614 615 if (strcasecmp("dbm", type) == 0) { 616 sc->cache_type = mgs_cache_dbm; 598 617 } else if (strcasecmp("gdbm", type) == 0) { 599 618 sc->cache_type = mgs_cache_gdbm; 600 619 } 601 620 #if HAVE_APR_MEMCACHE 602 621 else if (strcasecmp("memcache", type) == 0) { 603 622 sc->cache_type = mgs_cache_memcache; 604 623 } 605 624 #endif 606 625 else { 607 626 return "Invalid Type for GnuTLSCache!"; 608 627 } 609 628 610 629 if (arg == NULL) 611 630 return "Invalid argument 2 for GnuTLSCache!"; 612 631 613 632 if (sc->cache_type == mgs_cache_dbm 614 615 633 || sc->cache_type == mgs_cache_gdbm) { 634 sc->cache_config = ap_server_root_relative(parms->pool, arg); 616 635 } else { 617 636 sc->cache_config = apr_pstrdup(parms->pool, arg); 618 637 } 619 638 -
src/gnutls_config.h
r7921dc7 r0470e44 1 1 /* 2 * Copyright 2016 Fiona Klute2 * Copyright 2016-2018 Fiona Klute 3 3 * 4 4 * Licensed under the Apache License, Version 2.0 (the "License"); … … 27 27 * mod_gnutls.h.in over here */ 28 28 29 const char *mgs_set_cache(cmd_parms * parms, void *dummy, 30 const char *type, const char* arg); 31 29 32 #endif /* __MOD_GNUTLS_CONFIG_H__ */ -
src/mod_gnutls.c
r7921dc7 r0470e44 19 19 20 20 #include "mod_gnutls.h" 21 #include "gnutls_config.h" 21 22 #include "gnutls_ocsp.h" 22 23 #include "gnutls_util.h"
Note: See TracChangeset
for help on using the changeset viewer.