Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 85 lines (69 sloc) 2.33 kB
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
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 *
920e20b @alobbs Happy new year!
alobbs authored
8 * Copyright (C) 2001-2011 Alvaro Lopez Ortega
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
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
2c39092 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2660 5dc97367-9…
alobbs authored
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * 02110-1301, USA.
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
23 */
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
24
25 #include "logger_combined.h"
26 #include "logger_ncsa.h"
b8698b6 @alobbs Fixes a bunch of compilation warnings
alobbs authored
27 #include "plugin.h"
b69d2e0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@476 5dc97367-97…
alobbs authored
28 #include "plugin_loader.h"
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
29
30
b69d2e0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@476 5dc97367-97…
alobbs authored
31 /* Plug-in definition
32 */
b8698b6 @alobbs Fixes a bunch of compilation warnings
alobbs authored
33 PLUGIN_INFO_LOGGER_EASY_INIT(combined);
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
34
35
36 ret_t
6392f7f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@3045 5dc97367-9…
alobbs authored
37 cherokee_logger_combined_new (cherokee_logger_t **logger,
38 cherokee_virtual_server_t *vsrv,
39 cherokee_config_node_t *config)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
40 {
41 ret_t ret;
42 CHEROKEE_NEW_STRUCT(n, logger_combined);
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
43
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
44 /* Init the base class object
45 */
4b729c5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@3057 5dc97367-9…
alobbs authored
46 cherokee_logger_init_base (LOGGER(n), PLUGIN_INFO_PTR(combined), config);
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
47
c5fe3a4 @alobbs Errors are not longer written through the logger objects. They are
alobbs authored
48 MODULE(n)->init = (logger_func_init_t) cherokee_logger_ncsa_init;
49 MODULE(n)->free = (logger_func_free_t) cherokee_logger_ncsa_free;
50 LOGGER(n)->flush = (logger_func_flush_t) cherokee_logger_ncsa_flush;
51 LOGGER(n)->reopen = (logger_func_flush_t) cherokee_logger_ncsa_reopen;
52 LOGGER(n)->write_access = (logger_func_write_access_t) cherokee_logger_ncsa_write_access;
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
53
54 /* Init the base class: NCSA
55 */
6392f7f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@3045 5dc97367-9…
alobbs authored
56 ret = cherokee_logger_ncsa_init_base (n, vsrv, config);
369cfd2 @alobbs "Possible memory leak. Dynamic memory stored in 'n' allocated through
alobbs authored
57 if (unlikely(ret < ret_ok)) {
58 cherokee_logger_free (LOGGER(n));
59 return ret;
60 }
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
61
62 /* Active the "Combined" bit
63 */
64 n->combined = true;
65
66 /* Return the object
67 */
68 *logger = LOGGER(n);
69 return ret_ok;
70 }
71
72
73 /* Library init function
74 */
75 static cherokee_boolean_t _combined_is_init = false;
76
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
77 void
b8698b6 @alobbs Fixes a bunch of compilation warnings
alobbs authored
78 PLUGIN_INIT_NAME(combined) (cherokee_plugin_loader_t *loader)
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
79 {
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
80 if (_combined_is_init) return;
81 _combined_is_init = true;
82
b69d2e0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@476 5dc97367-97…
alobbs authored
83 cherokee_plugin_loader_load (loader, "ncsa");
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
84 }
Something went wrong with that request. Please try again.