1 | /* ==================================================================== |
---|
2 | * Copyright 2004 Paul Querna |
---|
3 | * |
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
---|
5 | * you may not use this file except in compliance with the License. |
---|
6 | * You may obtain a copy of the License at |
---|
7 | * |
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
9 | * |
---|
10 | * Unless required by applicable law or agreed to in writing, software |
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
13 | * See the License for the specific language governing permissions and |
---|
14 | * limitations under the License. |
---|
15 | * |
---|
16 | */ |
---|
17 | |
---|
18 | #include "mod_gnutls.h" |
---|
19 | |
---|
20 | /** |
---|
21 | * GnuTLS Session Cache using libmemcached |
---|
22 | * |
---|
23 | */ |
---|
24 | /* |
---|
25 | #include "memcache.h" |
---|
26 | |
---|
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 | */ |
---|