Skip to content
This repository
Newer
Older
100644 79 lines (63 sloc) 1.736 kb
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
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 *
9ba6eafc »
2008-02-21 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1131 5dc97367-9…
8 * Copyright (C) 2001-2008 Alvaro Lopez Ortega
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24
25 #include "common-internal.h"
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
26 #include "rule.h"
27 #include "connection.h"
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
28
29
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
30 ret_t
31 cherokee_rule_init_base (cherokee_rule_t *rule, cherokee_plugin_info_t *info)
32 {
33 INIT_LIST_HEAD (&rule->list_node);
05294651 »
2006-06-04 git-svn-id: svn://cherokee-project.com/cherokee/trunk@289 5dc97367-97…
34
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
35 rule->match = NULL;
36 rule->final = true;
37 rule->priority = CHEROKEE_RULE_PRIO_NONE;
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
38
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
39 cherokee_config_entry_init (&rule->config);
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
40 return ret_ok;
41 }
42
43
44 ret_t
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
45 cherokee_rule_free (cherokee_rule_t *rule)
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
46 {
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
47 /* Sanity checks
48 */
49 return_if_fail (rule != NULL, ret_error);
2a5defc7 »
2006-12-11 git-svn-id: svn://cherokee-project.com/cherokee/trunk@506 5dc97367-97…
50
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
51 if (MODULE(rule)->free == NULL) {
52 return ret_error;
53 }
05294651 »
2006-06-04 git-svn-id: svn://cherokee-project.com/cherokee/trunk@289 5dc97367-97…
54
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
55 MODULE(rule)->free (rule);
56
57 /* Free the rule
58 */
59 free (rule);
05294651 »
2006-06-04 git-svn-id: svn://cherokee-project.com/cherokee/trunk@289 5dc97367-97…
60 return ret_ok;
ae9d9717 »
2006-04-01 git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
61 }
62
337832ad »
2008-04-08 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
63
64 ret_t
65 cherokee_rule_match (cherokee_rule_t *rule, void *cnt)
66 {
67 /* Sanity checks
68 */
69 return_if_fail (rule != NULL, ret_error);
70
71 if (rule->match == NULL) {
72 return ret_error;
73 }
74
75 /* Call the real method
76 */
77 return rule->match (rule, CONN(cnt));
78 }
Something went wrong with that request. Please try again.