Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 194 lines (158 sloc) 4.847 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/* Cherokee
*
* Authors:
* Alvaro Lopez Ortega <alvaro@alobbs.com>
*
* Copyright (C) 2001-2011 Alvaro Lopez Ortega
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/

#ifndef CHEROKEE_SERVER_PROTECTED_H
#define CHEROKEE_SERVER_PROTECTED_H

#include "common-internal.h"

#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#else
# include <time.h>
#endif

#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#include "server.h"
#include "list.h"
#include "fdpoll.h"
#include "virtual_server.h"
#include "thread.h"
#include "plugin_loader.h"
#include "icons.h"
#include "iocache.h"
#include "regex.h"
#include "nonce.h"
#include "mime.h"
#include "config_node.h"
#include "version.h"
#include "cryptor.h"
#include "logger_writer.h"
#include "collector.h"
#include "post_track.h"

struct cherokee_server {
/* Exit related
*/
time_t start_time;
cherokee_buffer_t panic_action;

/* Restarts
*/
cherokee_boolean_t wanna_exit;
cherokee_boolean_t wanna_reinit;

/* Virtual servers
*/
cherokee_list_t vservers;

/* Threads
*/
cherokee_thread_t *main_thread;
cint_t thread_num;
cherokee_list_t thread_list;
cint_t thread_policy;

/* Modules
*/
cherokee_plugin_loader_t loader;
cherokee_avl_t encoders;

/* Tables: nonces, etc
*/
cherokee_regex_table_t *regexs;
cherokee_nonce_table_t *nonces;

/* Programmed tasks
*/
int nonces_cleanup_lapse;
time_t nonces_cleanup_next;

int flcache_lapse;
time_t flcache_next;

/* Logging
*/
cherokee_logger_writer_t *error_writer;

cherokee_list_t logger_writers;
cherokee_avl_t logger_writers_index;

int log_flush_lapse;
time_t log_flush_next;

/* Extensions
*/
cherokee_cryptor_t *cryptor;
cherokee_post_track_t *post_track;
cherokee_collector_t *collector;

/* System related
*/
int fdlimit_custom;
int fdlimit_available;
cherokee_poll_type_t fdpoll_method;

/* Connection related
*/
cuint_t conns_max;
cint_t conns_reuse_max;

cherokee_boolean_t keepalive;
cuint_t keepalive_max;
cherokee_boolean_t chunked_encoding;

/* Networking config
*/
cherokee_boolean_t ipv6;
int fdwatch_msecs;
int listen_queue;
cherokee_boolean_t tls_enabled;

cherokee_list_t listeners;
CHEROKEE_MUTEX_T (listeners_mutex);

/* Server name
*/
cherokee_server_token_t server_token;

/* User/group and chroot
*/
uid_t user;
uid_t user_orig;
gid_t group;
gid_t group_orig;

cherokee_buffer_t chroot;
cherokee_boolean_t chrooted;

/* I/O cache
*/
cherokee_iocache_t *iocache;
cherokee_boolean_t iocache_enabled;

/* Other objects
*/
cherokee_mime_t *mime;
cherokee_icons_t *icons;
cherokee_avl_t sources;

/* Time related
*/
int timeout;
cherokee_buffer_t timeout_header;

struct {
off_t min;
off_t max;
} sendfile;

/* Another config files
*/
cherokee_config_node_t config;

/* Paths
*/
cherokee_buffer_t pidfile;
cherokee_buffer_t themes_dir;
};


ret_t cherokee_server_del_connection (cherokee_server_t *srv, char *begin);
ret_t cherokee_server_get_vserver (cherokee_server_t *srv, cherokee_buffer_t *name, cherokee_connection_t *conn, cherokee_virtual_server_t **vsrv);
ret_t cherokee_server_get_next_bind (cherokee_server_t *srv, cherokee_bind_t *bind, cherokee_bind_t **next);
ret_t cherokee_server_get_log_writer (cherokee_server_t *srv, cherokee_config_node_t *config, cherokee_logger_writer_t **writer);

#endif /* CHEROKEE_SERVER_PROTECTED_H */
Something went wrong with that request. Please try again.