aboutsummaryrefslogtreecommitdiffstats
path: root/src/gnutls_cache.c
diff options
context:
space:
mode:
authorGravatar Paul Querna 2005-04-24 22:21:50 +0000
committerGravatar Paul Querna 2005-04-24 22:21:50 +0000
commitc301152dbbdf13c4bf212c7982b948c21149468d (patch)
tree311447345aca9ee56f930428843aef6a7e48569d /src/gnutls_cache.c
parent46b85d8e3634f34c0142823d92b037dd33b67898 (diff)
- move hooks to gnutls_hooks.c
- use 'mgs_' as the prefix for all symbols, instead of mixed prefixes.
Diffstat (limited to 'src/gnutls_cache.c')
-rw-r--r--src/gnutls_cache.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c
index 8499b84..4c094fa 100644
--- a/src/gnutls_cache.c
+++ b/src/gnutls_cache.c
@@ -53,7 +53,7 @@ static char *gnutls_session_id2sz(unsigned char *id, int idlen,
53 return str; 53 return str;
54} 54}
55 55
56char *mod_gnutls_session_id2sz(unsigned char *id, int idlen, 56char *mgs_session_id2sz(unsigned char *id, int idlen,
57 char *str, int strsize) 57 char *str, int strsize)
58{ 58{
59 char *cp; 59 char *cp;
@@ -80,7 +80,7 @@ char *mod_gnutls_session_id2sz(unsigned char *id, int idlen,
80static apr_memcache_t* mc; 80static apr_memcache_t* mc;
81 81
82static int mc_cache_child_init(apr_pool_t *p, server_rec *s, 82static int mc_cache_child_init(apr_pool_t *p, server_rec *s,
83 mod_gnutls_srvconf_rec *sc) 83 mgs_srvconf_rec *sc)
84{ 84{
85 apr_status_t rv = APR_SUCCESS; 85 apr_status_t rv = APR_SUCCESS;
86 int thread_limit = 0; 86 int thread_limit = 0;
@@ -166,7 +166,7 @@ static int mc_cache_store(void* baton, gnutls_datum_t key,
166 gnutls_datum_t data) 166 gnutls_datum_t data)
167{ 167{
168 apr_status_t rv = APR_SUCCESS; 168 apr_status_t rv = APR_SUCCESS;
169 mod_gnutls_handle_t *ctxt = baton; 169 mgs_handle_t *ctxt = baton;
170 char buf[STR_SESSION_LEN]; 170 char buf[STR_SESSION_LEN];
171 char* strkey = NULL; 171 char* strkey = NULL;
172 apr_uint32_t timeout; 172 apr_uint32_t timeout;
@@ -193,7 +193,7 @@ static int mc_cache_store(void* baton, gnutls_datum_t key,
193static gnutls_datum_t mc_cache_fetch(void* baton, gnutls_datum_t key) 193static gnutls_datum_t mc_cache_fetch(void* baton, gnutls_datum_t key)
194{ 194{
195 apr_status_t rv = APR_SUCCESS; 195 apr_status_t rv = APR_SUCCESS;
196 mod_gnutls_handle_t *ctxt = baton; 196 mgs_handle_t *ctxt = baton;
197 char buf[STR_SESSION_LEN]; 197 char buf[STR_SESSION_LEN];
198 char* strkey = NULL; 198 char* strkey = NULL;
199 char* value; 199 char* value;
@@ -234,7 +234,7 @@ static gnutls_datum_t mc_cache_fetch(void* baton, gnutls_datum_t key)
234static int mc_cache_delete(void* baton, gnutls_datum_t key) 234static int mc_cache_delete(void* baton, gnutls_datum_t key)
235{ 235{
236 apr_status_t rv = APR_SUCCESS; 236 apr_status_t rv = APR_SUCCESS;
237 mod_gnutls_handle_t *ctxt = baton; 237 mgs_handle_t *ctxt = baton;
238 char buf[STR_SESSION_LEN]; 238 char buf[STR_SESSION_LEN];
239 char* strkey = NULL; 239 char* strkey = NULL;
240 240
@@ -259,7 +259,7 @@ static int mc_cache_delete(void* baton, gnutls_datum_t key)
259 259
260#define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD ) 260#define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD )
261 261
262static int dbm_cache_expire(mod_gnutls_handle_t *ctxt) 262static int dbm_cache_expire(mgs_handle_t *ctxt)
263{ 263{
264 apr_status_t rv; 264 apr_status_t rv;
265 apr_dbm_t *dbm; 265 apr_dbm_t *dbm;
@@ -346,7 +346,7 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key)
346 apr_dbm_t *dbm; 346 apr_dbm_t *dbm;
347 apr_datum_t dbmkey; 347 apr_datum_t dbmkey;
348 apr_datum_t dbmval; 348 apr_datum_t dbmval;
349 mod_gnutls_handle_t *ctxt = baton; 349 mgs_handle_t *ctxt = baton;
350 apr_status_t rv; 350 apr_status_t rv;
351 351
352 dbmkey.dptr = key.data; 352 dbmkey.dptr = key.data;
@@ -395,7 +395,7 @@ static int dbm_cache_store(void* baton, gnutls_datum_t key,
395 apr_dbm_t *dbm; 395 apr_dbm_t *dbm;
396 apr_datum_t dbmkey; 396 apr_datum_t dbmkey;
397 apr_datum_t dbmval; 397 apr_datum_t dbmval;
398 mod_gnutls_handle_t *ctxt = baton; 398 mgs_handle_t *ctxt = baton;
399 apr_status_t rv; 399 apr_status_t rv;
400 apr_time_t expiry; 400 apr_time_t expiry;
401 401
@@ -448,7 +448,7 @@ static int dbm_cache_delete(void* baton, gnutls_datum_t key)
448{ 448{
449 apr_dbm_t *dbm; 449 apr_dbm_t *dbm;
450 apr_datum_t dbmkey; 450 apr_datum_t dbmkey;
451 mod_gnutls_handle_t *ctxt = baton; 451 mgs_handle_t *ctxt = baton;
452 apr_status_t rv; 452 apr_status_t rv;
453 453
454 dbmkey.dptr = (char *)key.data; 454 dbmkey.dptr = (char *)key.data;
@@ -483,7 +483,7 @@ static int dbm_cache_delete(void* baton, gnutls_datum_t key)
483} 483}
484 484
485static int dbm_cache_post_config(apr_pool_t *p, server_rec *s, 485static int dbm_cache_post_config(apr_pool_t *p, server_rec *s,
486 mod_gnutls_srvconf_rec *sc) 486 mgs_srvconf_rec *sc)
487{ 487{
488 apr_status_t rv; 488 apr_status_t rv;
489 apr_dbm_t *dbm; 489 apr_dbm_t *dbm;
@@ -518,23 +518,23 @@ static int dbm_cache_post_config(apr_pool_t *p, server_rec *s,
518 return rv; 518 return rv;
519} 519}
520 520
521int mod_gnutls_cache_post_config(apr_pool_t *p, server_rec *s, 521int mgs_cache_post_config(apr_pool_t *p, server_rec *s,
522 mod_gnutls_srvconf_rec *sc) 522 mgs_srvconf_rec *sc)
523{ 523{
524 if (sc->cache_type == mod_gnutls_cache_dbm) { 524 if (sc->cache_type == mgs_cache_dbm) {
525 return dbm_cache_post_config(p, s, sc); 525 return dbm_cache_post_config(p, s, sc);
526 } 526 }
527 return 0; 527 return 0;
528} 528}
529 529
530int mod_gnutls_cache_child_init(apr_pool_t *p, server_rec *s, 530int mgs_cache_child_init(apr_pool_t *p, server_rec *s,
531 mod_gnutls_srvconf_rec *sc) 531 mgs_srvconf_rec *sc)
532{ 532{
533 if (sc->cache_type == mod_gnutls_cache_dbm) { 533 if (sc->cache_type == mgs_cache_dbm) {
534 return 0; 534 return 0;
535 } 535 }
536#if HAVE_APR_MEMCACHE 536#if HAVE_APR_MEMCACHE
537 else if (sc->cache_type == mod_gnutls_cache_memcache) { 537 else if (sc->cache_type == mgs_cache_memcache) {
538 return mc_cache_child_init(p, s, sc); 538 return mc_cache_child_init(p, s, sc);
539 } 539 }
540#endif 540#endif
@@ -543,16 +543,16 @@ int mod_gnutls_cache_child_init(apr_pool_t *p, server_rec *s,
543 543
544 #include <assert.h> 544 #include <assert.h>
545 545
546int mod_gnutls_cache_session_init(mod_gnutls_handle_t *ctxt) 546int mgs_cache_session_init(mgs_handle_t *ctxt)
547{ 547{
548 if (ctxt->sc->cache_type == mod_gnutls_cache_dbm) { 548 if (ctxt->sc->cache_type == mgs_cache_dbm) {
549 gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch); 549 gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch);
550 gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete); 550 gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete);
551 gnutls_db_set_store_function(ctxt->session, dbm_cache_store); 551 gnutls_db_set_store_function(ctxt->session, dbm_cache_store);
552 gnutls_db_set_ptr(ctxt->session, ctxt); 552 gnutls_db_set_ptr(ctxt->session, ctxt);
553 } 553 }
554#if HAVE_APR_MEMCACHE 554#if HAVE_APR_MEMCACHE
555 else if (ctxt->sc->cache_type == mod_gnutls_cache_memcache) { 555 else if (ctxt->sc->cache_type == mgs_cache_memcache) {
556 gnutls_db_set_retrieve_function(ctxt->session, mc_cache_fetch); 556 gnutls_db_set_retrieve_function(ctxt->session, mc_cache_fetch);
557 gnutls_db_set_remove_function(ctxt->session, mc_cache_delete); 557 gnutls_db_set_remove_function(ctxt->session, mc_cache_delete);
558 gnutls_db_set_store_function(ctxt->session, mc_cache_store); 558 gnutls_db_set_store_function(ctxt->session, mc_cache_store);