Skip to content
This repository
Newer
Older
100644 108 lines (85 sloc) 3.886 kb
a68f41b1 »
2011-05-03 Merges the Front-Line Cache branch.
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_H
30 #define CHEROKEE_FLCACHE_H
31
32 #include <cherokee/common.h>
33 #include <cherokee/buffer.h>
34 #include <cherokee/avl_flcache.h>
35 #include <cherokee/connection.h>
36 #include <cherokee/config_node.h>
37
38 CHEROKEE_BEGIN_DECLS
39
40 /* Forward declaration */
41 typedef struct cherokee_flcache cherokee_flcache_t;
42 typedef struct cherokee_flcache_entry cherokee_flcache_entry_t;
43 typedef struct cherokee_flcache_conn cherokee_flcache_conn_t;
44
45 /* Classes
46 */
47
48 typedef enum {
d7c81afc »
2011-05-14 Expiration headers returned by Front-Line Cache can now be overwritten.
49 flcache_mode_undef,
a68f41b1 »
2011-05-03 Merges the Front-Line Cache branch.
50 flcache_mode_in,
0e40230e »
2011-05-10 Fixes a few corner cases on Front-Line Cache.
51 flcache_mode_out,
52 flcache_mode_error
a68f41b1 »
2011-05-03 Merges the Front-Line Cache branch.
53 } cherokee_flcache_mode_t;
54
55 typedef enum {
56 flcache_policy_explicitly_allowed,
57 flcache_policy_all_but_forbidden
58 } cherokee_flcache_policy_t;
59
60
61 struct cherokee_flcache {
62 cherokee_avl_flcache_t request_map;
63 cherokee_buffer_t local_directory;
64 culong_t last_file_id;
65 };
66
67 struct cherokee_flcache_conn {
68 cherokee_flcache_mode_t mode;
69 int fd;
70
71 /* Outbound */
72 clong_t header_sent;
73 clong_t response_sent;
74 cherokee_avl_flcache_node_t *avl_node_ref;
75 cherokee_buffer_t header;
76 };
77
78
79 /* Front-line cache
80 */
81 ret_t cherokee_flcache_new (cherokee_flcache_t **flcache);
82 ret_t cherokee_flcache_free (cherokee_flcache_t *flcache);
83 ret_t cherokee_flcache_configure (cherokee_flcache_t *flcache, cherokee_config_node_t *conf, void *vserver);
84
85 ret_t cherokee_flcache_cleanup (cherokee_flcache_t *flcache);
86 ret_t cherokee_flcache_req_get_cached (cherokee_flcache_t *flcache, cherokee_connection_t *conn);
87 ret_t cherokee_flcache_req_is_storable (cherokee_flcache_t *flcache, cherokee_connection_t *conn);
88 ret_t cherokee_flcache_req_set_store (cherokee_flcache_t *flcache, cherokee_connection_t *conn);
89 ret_t cherokee_flcache_del_entry (cherokee_flcache_t *flcache, cherokee_avl_flcache_node_t *entry);
44b8a3d6 »
2011-05-07 Handler 'Remote Administration' has been enhancement to support
90 ret_t cherokee_flcache_purge_path (cherokee_flcache_t *flcache, cherokee_buffer_t *path);
a68f41b1 »
2011-05-03 Merges the Front-Line Cache branch.
91
92 /* Front-line cache connection
93 */
94 ret_t cherokee_flcache_conn_init (cherokee_flcache_conn_t *flcache_conn);
95 ret_t cherokee_flcache_conn_clean (cherokee_flcache_conn_t *flcache_conn);
96
97 ret_t cherokee_flcache_conn_write_header (cherokee_flcache_conn_t *flcache_conn, cherokee_connection_t *conn);
98 ret_t cherokee_flcache_conn_write_body (cherokee_flcache_conn_t *flcache_conn, cherokee_connection_t *conn);
99 ret_t cherokee_flcache_conn_commit_header (cherokee_flcache_conn_t *flcache_conn, cherokee_connection_t *conn);
100
101 ret_t cherokee_flcache_conn_send_header (cherokee_flcache_conn_t *flcache_conn, cherokee_connection_t *conn);
102 ret_t cherokee_flcache_conn_send_body (cherokee_flcache_conn_t *flcache_conn, cherokee_connection_t *conn);
103
104
105 CHEROKEE_END_DECLS
106
107 #endif /* CHEROKEE_FLCACHE_H */
Something went wrong with that request. Please try again.