Changeset 771ca63 in mod_gnutls for src


Ignore:
Timestamp:
Sep 23, 2010, 3:35:27 AM (9 years ago)
Author:
Nikos Mavrogiannopoulos <nmav@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, 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)
Message:

The GnuTLSCache variable now can be given the specific
option "sdbm" instead of "dbm". "dbm" will use the default
dbm type of libapr while sdbm will force sdbm to be used.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    r0fce7c2 r771ca63  
    3636/* it seems the default has some strange errors. Use SDBM
    3737 */
    38 #define ODB "SDBM"
    39 
    4038#define MC_TAG "mod_gnutls:"
    4139#define MC_TAG_LEN sizeof(MC_TAG)
     
    297295#endif /* have_apr_memcache */
    298296
     297const 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
    299305#define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD )
    300306
     
    322328    deleted = 0;
    323329
    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,
    325331                      SSL_DBM_FILE_MODE, spool);
    326332    if (rv != APR_SUCCESS) {
     
    375381        return data;
    376382
    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,
    378384                      APR_DBM_READONLY, SSL_DBM_FILE_MODE, ctxt->c->pool);
    379385    if (rv != APR_SUCCESS) {
     
    445451           data.data, data.size);
    446452
    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,
    448454                      APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, ctxt->c->pool);
    449455    if (rv != APR_SUCCESS) {
     
    485491        return -1;
    486492
    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,
    488494                      APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, ctxt->c->pool);
    489495    if (rv != APR_SUCCESS) {
     
    519525    const char* path2;
    520526
    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,
    522528                      SSL_DBM_FILE_MODE, p);
    523529
     
    531537    apr_dbm_close(dbm);
    532538
    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);
    534540
    535541    /* The Following Code takes logic directly from mod_ssl's DBM Cache */
     
    550556                                 mgs_srvconf_rec *sc)
    551557{
    552     if (sc->cache_type == mgs_cache_dbm) {
     558    if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) {
    553559        return dbm_cache_post_config(p, s, sc);
    554560    }
     
    559565                                mgs_srvconf_rec *sc)
    560566{
    561     if (sc->cache_type == mgs_cache_dbm) {
     567    if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) {
    562568        return 0;
    563569    }
     
    574580int mgs_cache_session_init(mgs_handle_t *ctxt)
    575581{
    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) {
    577583        gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch);
    578584        gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete);
  • src/gnutls_config.c

    r0fce7c2 r771ca63  
    344344    }
    345345
    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) {
    348349        sc->cache_type = mgs_cache_dbm;
     350    }
     351    else if (strcasecmp("sdbm", type) == 0) {
     352        sc->cache_type = mgs_cache_sdbm;
    349353    }
    350354#if HAVE_APR_MEMCACHE
     
    357361    }
    358362
    359     if (sc->cache_type == mgs_cache_dbm) {
     363    if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) {
    360364        sc->cache_config = ap_server_root_relative(parms->pool, arg);
    361365    } else {
Note: See TracChangeset for help on using the changeset viewer.