diff options
Diffstat (limited to 'src/gnutls_cache.c')
-rw-r--r-- | src/gnutls_cache.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c index f2fb803..683cdf4 100644 --- a/src/gnutls_cache.c +++ b/src/gnutls_cache.c | |||
@@ -21,5 +21,41 @@ | |||
21 | * GnuTLS Session Cache using libmemcached | 21 | * GnuTLS Session Cache using libmemcached |
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | /* | ||
25 | #include "memcache.h" | ||
24 | 26 | ||
25 | #include "libmemcache/memcache.h" | 27 | int mod_gnutls_cache_init() |
28 | { | ||
29 | return 0; | ||
30 | } | ||
31 | static int cache_store((void* baton, gnutls_datum_t key, gnutls_datum_t data) | ||
32 | { | ||
33 | mc_set(struct memcache *mc, | ||
34 | key->data, key->size, | ||
35 | data->data, data->size, | ||
36 | 3600, 0); | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static int cache_fetch(void* baton, gnutls_datum_t key) | ||
41 | { | ||
42 | mod_gnutls_handle_t *ctxt = baton; | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | static int cache_delete(void* baton, gnutls_datum_t key) | ||
47 | { | ||
48 | mod_gnutls_handle_t *ctxt = baton; | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | int mod_gnutls_cache_session_init(mod_gnutls_handle_t *ctxt) | ||
53 | { | ||
54 | gnutls_db_set_cache_expiration | ||
55 | gnutls_db_set_retrieve_function(session, cache_fetch); | ||
56 | gnutls_db_set_remove_function(session, cache_delete); | ||
57 | gnutls_db_set_store_function(session, cache_store); | ||
58 | gnutls_db_set_ptr(session, NULL); | ||
59 | return 0; | ||
60 | } | ||
61 | */ | ||