Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 101 lines (76 sloc) 3.103 kb
a68f41b @alobbs Merges the Front-Line Cache branch.
alobbs authored
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* Cherokee
4 *
5 * Authors:
6 * Alvaro Lopez Ortega <alvaro@alobbs.com>
7 *
8 * Copyright (C) 2001-2010 Alvaro Lopez Ortega
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * 02110-1301, USA.
23 */
24
25 #if !defined (CHEROKEE_INSIDE_CHEROKEE_H) && !defined (CHEROKEE_COMPILATION)
26 # error "Only <cherokee/cherokee.h> can be included directly, this file may disappear or change contents."
27 #endif
28
29 #ifndef CHEROKEE_FLCACHE_AVL_H
30 #define CHEROKEE_FLCACHE_AVL_H
31
32 #include <cherokee/common.h>
33 #include <cherokee/avl_generic.h>
34 #include <cherokee/connection.h>
35
36 CHEROKEE_BEGIN_DECLS
37
38 typedef enum {
39 flcache_status_undef,
40 flcache_status_storing,
41 flcache_status_ready
42 } cherokee_flcache_status_t;
43
44 /* AVL Tree Node
45 */
46 typedef struct {
47 cherokee_avl_generic_node_t base;
48 cherokee_list_t to_del;
49
50 cint_t ref_count;
51 CHEROKEE_MUTEX_T (ref_count_mutex);
52
53 cherokee_buffer_t request;
54 cherokee_buffer_t query_string;
55 cherokee_buffer_t content_encoding;
56
57 cherokee_connection_t *conn_ref;
58
59 cherokee_flcache_status_t status;
60 cherokee_buffer_t file;
61 cullong_t file_size;
62
63 time_t created_at;
64 time_t valid_until;
65 } cherokee_avl_flcache_node_t;
66
67
68 /* AVL Tree
69 */
70 typedef struct {
71 cherokee_avl_generic_t base;
72 CHEROKEE_RWLOCK_T (base_rwlock);
73 } cherokee_avl_flcache_t;
74
75
76 #define AVL_FLCACHE(a) ((cherokee_avl_flcache_t *)(a))
77 #define AVL_FLCACHE_NODE(a) ((cherokee_avl_flcache_node_t *)(a))
78
79
80 ret_t cherokee_avl_flcache_init (cherokee_avl_flcache_t *avl);
81 ret_t cherokee_avl_flcache_mrproper (cherokee_avl_flcache_t *avl, cherokee_func_free_t free_value);
82 ret_t cherokee_avl_flcache_cleanup (cherokee_avl_flcache_t *avl);
83
44b8a3d @alobbs Handler 'Remote Administration' has been enhancement to support
alobbs authored
84 ret_t cherokee_avl_flcache_add (cherokee_avl_flcache_t *avl,
85 cherokee_connection_t *conn,
86 cherokee_avl_flcache_node_t **node);
a68f41b @alobbs Merges the Front-Line Cache branch.
alobbs authored
87
44b8a3d @alobbs Handler 'Remote Administration' has been enhancement to support
alobbs authored
88 ret_t cherokee_avl_flcache_get (cherokee_avl_flcache_t *avl,
89 cherokee_connection_t *conn,
90 cherokee_avl_flcache_node_t **node);
a68f41b @alobbs Merges the Front-Line Cache branch.
alobbs authored
91
44b8a3d @alobbs Handler 'Remote Administration' has been enhancement to support
alobbs authored
92 ret_t cherokee_avl_flcache_del (cherokee_avl_flcache_t *avl,
93 cherokee_avl_flcache_node_t *node);
94
95 ret_t cherokee_avl_flcache_purge_path (cherokee_avl_flcache_t *avl,
96 cherokee_buffer_t *path);
a68f41b @alobbs Merges the Front-Line Cache branch.
alobbs authored
97
98 CHEROKEE_END_DECLS
99
100 #endif /* CHEROKEE_FLCACHE_AVL_H */
Something went wrong with that request. Please try again.