Changeset 76bd3bf in mod_gnutls for src


Ignore:
Timestamp:
Dec 9, 2004, 6:45:10 PM (15 years ago)
Author:
Paul Querna <chip@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, upstream
Children:
a66e147
Parents:
32f2e60
Message:

add check for apr_memcache

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mod_gnutls.c

    r32f2e60 r76bd3bf  
    5353{
    5454    mod_gnutls_srvconf_rec *sc;
     55    void *data = NULL;
     56    int first_run = 0;
    5557    server_rec *s;
    5658    gnutls_dh_params_t dh_params;
     
    5860    gnutls_rsa_params_t rsa_params;
    5961#endif
    60 
    61     /* TODO: Should we regenerate these after X requests / X time ? */
    62     gnutls_dh_params_init(&dh_params);
    63     gnutls_dh_params_generate2(dh_params, DH_BITS);
     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
     72
     73    if(first_run) {
     74        /* TODO: Should we regenerate these after X requests / X time ? */
     75        gnutls_dh_params_init(&dh_params);
     76        gnutls_dh_params_generate2(dh_params, DH_BITS);
    6477#ifdef USE_RSA
    65     gnutls_rsa_params_init(&rsa_params);
    66     gnutls_rsa_params_generate2(rsa_params, RSA_BITS);
    67 #endif
     78        gnutls_rsa_params_init(&rsa_params);
     79        gnutls_rsa_params_generate2(rsa_params, RSA_BITS);
     80#endif
     81    }
     82
    6883    for (s = base_server; s; s = s->next) {
    6984        sc = (mod_gnutls_srvconf_rec *) ap_get_module_config(s->module_config,
     
    87102
    88103    ap_add_version_component(p, "GnuTLS/" LIBGNUTLS_VERSION);
     104
    89105    return OK;
    90106}
Note: See TracChangeset for help on using the changeset viewer.