diff options
author | Paul Querna | 2004-12-09 23:45:10 +0000 |
---|---|---|
committer | Paul Querna | 2004-12-09 23:45:10 +0000 |
commit | 76bd3bfed0fda6fb670cb14c16bcdfd47453dfe5 (patch) | |
tree | 673adf6a89ebae3645354b8e5328d5da0122e538 /src/mod_gnutls.c | |
parent | 32f2e601850dbbfb34180763df507d103c6b6aff (diff) |
add check for apr_memcache
Diffstat (limited to 'src/mod_gnutls.c')
-rw-r--r-- | src/mod_gnutls.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c index 04f7db9..3dfbd9a 100644 --- a/src/mod_gnutls.c +++ b/src/mod_gnutls.c | |||
@@ -52,19 +52,34 @@ static int mod_gnutls_hook_post_config(apr_pool_t * p, apr_pool_t * plog, | |||
52 | server_rec * base_server) | 52 | server_rec * base_server) |
53 | { | 53 | { |
54 | mod_gnutls_srvconf_rec *sc; | 54 | mod_gnutls_srvconf_rec *sc; |
55 | void *data = NULL; | ||
56 | int first_run = 0; | ||
55 | server_rec *s; | 57 | server_rec *s; |
56 | gnutls_dh_params_t dh_params; | 58 | gnutls_dh_params_t dh_params; |
57 | #ifdef USE_RSA | 59 | #ifdef USE_RSA |
58 | gnutls_rsa_params_t rsa_params; | 60 | gnutls_rsa_params_t rsa_params; |
59 | #endif | 61 | #endif |
62 | const char *userdata_key = "mod_gnutls_init"; | ||
63 | |||
64 | apr_pool_userdata_get(&data, userdata_key, base_server->process->pool); | ||
65 | if (data == NULL) { | ||
66 | first_run = 1; | ||
67 | apr_pool_userdata_set((const void *)1, userdata_key, | ||
68 | apr_pool_cleanup_null, | ||
69 | base_server->process->pool); | ||
70 | } | ||
71 | |||
60 | 72 | ||
61 | /* TODO: Should we regenerate these after X requests / X time ? */ | 73 | if(first_run) { |
62 | gnutls_dh_params_init(&dh_params); | 74 | /* TODO: Should we regenerate these after X requests / X time ? */ |
63 | gnutls_dh_params_generate2(dh_params, DH_BITS); | 75 | gnutls_dh_params_init(&dh_params); |
76 | gnutls_dh_params_generate2(dh_params, DH_BITS); | ||
64 | #ifdef USE_RSA | 77 | #ifdef USE_RSA |
65 | gnutls_rsa_params_init(&rsa_params); | 78 | gnutls_rsa_params_init(&rsa_params); |
66 | gnutls_rsa_params_generate2(rsa_params, RSA_BITS); | 79 | gnutls_rsa_params_generate2(rsa_params, RSA_BITS); |
67 | #endif | 80 | #endif |
81 | } | ||
82 | |||
68 | for (s = base_server; s; s = s->next) { | 83 | for (s = base_server; s; s = s->next) { |
69 | sc = (mod_gnutls_srvconf_rec *) ap_get_module_config(s->module_config, | 84 | sc = (mod_gnutls_srvconf_rec *) ap_get_module_config(s->module_config, |
70 | &gnutls_module); | 85 | &gnutls_module); |
@@ -86,6 +101,7 @@ static int mod_gnutls_hook_post_config(apr_pool_t * p, apr_pool_t * plog, | |||
86 | 101 | ||
87 | 102 | ||
88 | ap_add_version_component(p, "GnuTLS/" LIBGNUTLS_VERSION); | 103 | ap_add_version_component(p, "GnuTLS/" LIBGNUTLS_VERSION); |
104 | |||
89 | return OK; | 105 | return OK; |
90 | } | 106 | } |
91 | 107 | ||