Changeset 619c6bf in mod_gnutls for src/gnutls_cache.c


Ignore:
Timestamp:
Jan 11, 2013, 12:58:18 AM (8 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
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.
Message:

Merge tag 'upstream/0.5.9'

Upstream version 0.5.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    r9c4a744 r619c6bf  
    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_gdbm)
     300                return "gdbm";
     301        else
     302                return "db";
     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_gdbm) {
    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_gdbm) {
    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_gdbm) {
    577583        gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch);
    578584        gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete);
Note: See TracChangeset for help on using the changeset viewer.