source: bin/varnishd/heritage.h @ b7a50b

Revision b7a50b, 4.8 KB checked in by Dag Erling Smørgrav <des@…>, 5 years ago (diff)

Update Linpro copyright (about 3 months late). Someone should
probably s/Linpro/Redpill Linpro/ at some point.

git-svn-id:  http://www.varnish-cache.org/svn/trunk@4025 d4fa192b-c00b-0410-8231-f00ffab90ce4

  • Property mode set to 100644
Line 
1/*-
2 * Copyright (c) 2006 Verdens Gang AS
3 * Copyright (c) 2006-2009 Linpro AS
4 * All rights reserved.
5 *
6 * Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $Id$
30 *
31 * This file contains the heritage passed when mgt forks cache
32 */
33
34#include <pthread.h>
35
36#include "vqueue.h"
37
38struct listen_sock {
39        VTAILQ_ENTRY(listen_sock)       list;
40        int                             sock;
41        char                            *name;
42        struct vss_addr                 *addr;
43};
44
45VTAILQ_HEAD(listen_sock_head, listen_sock);
46
47struct heritage {
48
49        /* Two pipe(2)'s for CLI connection between cache and mgt.  */
50        int                             cli_in;
51        int                             cli_out;
52
53        /* File descriptor for stdout/stderr */
54        int                             std_fd;
55
56        /* Sockets from which to accept connections */
57        struct listen_sock_head         socks;
58        unsigned                        nsocks;
59
60        /* Share memory log fd and size (incl header) */
61        int                             vsl_fd;
62        unsigned                        vsl_size;
63
64        /* Hash method */
65        struct hash_slinger             *hash;
66
67        char                            name[1024];
68        char                            identity[1024];
69};
70
71struct params {
72
73        /* Unprivileged user / group */
74        char                    *user;
75        uid_t                   uid;
76        char                    *group;
77        gid_t                   gid;
78
79        /* TTL used for lack of anything better */
80        unsigned                default_ttl;
81
82        /* TTL used for synthesized error pages */
83        unsigned                err_ttl;
84
85        /* Worker threads and pool */
86        unsigned                wthread_min;
87        unsigned                wthread_max;
88        unsigned                wthread_timeout;
89        unsigned                wthread_pools;
90        unsigned                wthread_add_threshold;
91        unsigned                wthread_add_delay;
92        unsigned                wthread_fail_delay;
93        unsigned                wthread_purge_delay;
94
95        unsigned                overflow_max;
96
97        /* Memory allocation hints */
98        unsigned                sess_workspace;
99        unsigned                obj_workspace;
100        unsigned                shm_workspace;
101
102        unsigned                shm_reclen;
103
104        /* Acceptor hints */
105        unsigned                sess_timeout;
106        unsigned                pipe_timeout;
107        unsigned                send_timeout;
108
109        /* Management hints */
110        unsigned                auto_restart;
111
112        /* Fetcher hints */
113        unsigned                fetch_chunksize;
114
115#ifdef SENDFILE_WORKS
116        /* Sendfile object minimum size */
117        unsigned                sendfile_threshold;
118#endif
119
120        /* VCL traces */
121        unsigned                vcl_trace;
122
123        /* Listen address */
124        char                    *listen_address;
125
126        /* Listen depth */
127        unsigned                listen_depth;
128
129        /* HTTP proto behaviour */
130        unsigned                backend_http11;
131        unsigned                client_http11;
132
133        /* CLI related */
134        unsigned                cli_timeout;
135        unsigned                ping_interval;
136
137        /* LRU list ordering interval */
138        unsigned                lru_timeout;
139
140        /* Maximum restarts allowed */
141        unsigned                max_restarts;
142
143        /* Maximum esi:include depth allowed */
144        unsigned                max_esi_includes;
145
146        /* ESI parser hints */
147        unsigned                esi_syntax;
148
149        /* Rush exponent */
150        unsigned                rush_exponent;
151
152        /* Cache vbe_conns */
153        unsigned                cache_vbe_conns;
154
155        /* Default connection_timeout */
156        double                  connect_timeout;
157
158        /* Read timeouts for backend */
159        double                  first_byte_timeout;
160        double                  between_bytes_timeout;
161
162        /* How long to linger on sessions */
163        unsigned                session_linger;
164
165        /* CLI buffer size */
166        unsigned                cli_buffer;
167
168        /* Control diagnostic code */
169        unsigned                diag_bitmap;
170
171        /* Default grace period */
172        unsigned                default_grace;
173
174        /* Log hash string to shm */
175        unsigned                log_hash;
176
177        /* Log hash string to shm */
178        unsigned                save_hash;
179
180        /* Log local socket address to shm */
181        unsigned                log_local_addr;
182
183        /* Prefer IPv6 connections to backend*/
184        unsigned                prefer_ipv6;
185
186        /* Acceptable clockskew with backends */
187        unsigned                clock_skew;
188
189        /* Amount of time to sleep when running out of file
190           descriptors.  In msecs */
191        unsigned                accept_fd_holdoff;
192
193        /* Get rid of duplicate purges */
194        unsigned                purge_dups;
195
196        /* CLI banner */
197        unsigned                cli_banner;
198};
199
200extern volatile struct params *params;
201extern struct heritage heritage;
202
203void child_main(void);
204
205int varnish_instance(const char *n_arg, char *name, size_t namelen,
206    char *dir, size_t dirlen);
Note: See TracBrowser for help on using the repository browser.