Commit 9699424c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Split params.h from heritage.h, they are different beasts now.

Reduce scope of heritage.h
Reduce scope of libvcl.h
parent 4f9e61d6
......@@ -89,6 +89,7 @@ noinst_HEADERS = \
heritage.h \
mgt/mgt.h \
mgt/mgt_cli.h \
params.h \
storage/storage.h \
storage/storage_persistent.h \
vparam.h
......
......@@ -55,7 +55,7 @@
#endif
#include "heritage.h"
#include "params.h"
enum body_status {
#define BODYSTATUS(U,l) BS_##U,
......@@ -909,6 +909,7 @@ void VCL_Init(void);
void VCL_Refresh(struct VCL_conf **vcc);
void VCL_Rel(struct VCL_conf **vcc);
void VCL_Poll(void);
const char *VCL_Return_Name(unsigned method);
#define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct sess *);
#include "tbl/vcl_returns.h"
......
......@@ -31,6 +31,7 @@
#include "config.h"
#include "cache.h"
#include "heritage.h"
#include "vcli.h"
#include "vcli_priv.h"
......
......@@ -39,6 +39,7 @@
#include <stddef.h> // offsetof
#include "cache.h"
#include "heritage.h"
#include "cache_backend.h" // struct vbc
#include "hash/hash_slinger.h" // struct objhead
......
......@@ -33,6 +33,7 @@
#include <stdlib.h>
#include "cache.h"
#include "heritage.h"
#include "waiter/cache_waiter.h"
#include "hash/hash_slinger.h"
......
......@@ -44,7 +44,6 @@
#include "cache_backend.h"
#include "waiter/cache_waiter.h"
#include "libvcl.h"
#include "vcl.h"
/*
......@@ -226,7 +225,7 @@ pan_sess(const struct sess *sp)
#undef STEP
default: stp = NULL;
}
hand = VCC_Return_Name(sp->handling);
hand = VCL_Return_Name(sp->handling);
if (stp != NULL)
VSB_printf(vsp, " step = %s,\n", stp);
else
......
......@@ -46,6 +46,7 @@
#include <stdlib.h>
#include "cache.h"
#include "heritage.h"
#include "waiter/cache_waiter.h"
#include "vtcp.h"
......
......@@ -38,7 +38,6 @@
#include "cache.h"
#include "libvcl.h"
#include "vcl.h"
#include "vcli.h"
#include "vcli_priv.h"
......@@ -65,6 +64,21 @@ static struct vcls *vcl_active; /* protected by vcl_mtx */
/*--------------------------------------------------------------------*/
const char *
VCL_Return_Name(unsigned method)
{
switch (method) {
#define VCL_RET_MAC(l, U, B) case VCL_RET_##U: return(#l);
#include "tbl/vcl_returns.h"
#undef VCL_RET_MAC
default:
return (NULL);
}
}
/*--------------------------------------------------------------------*/
static void
VCL_Get(struct VCL_conf **vcc)
{
......@@ -323,7 +337,7 @@ VCL_##func##_method(struct sess *sp) \
sp->cur_method = VCL_MET_ ## upper; \
WSP(sp, SLT_VCL_call, "%s", #func); \
(void)sp->vcl->func##_func(sp); \
WSP(sp, SLT_VCL_return, "%s", VCC_Return_Name(sp->handling)); \
WSP(sp, SLT_VCL_return, "%s", VCL_Return_Name(sp->handling)); \
sp->cur_method = 0; \
assert((1U << sp->handling) & bitmap); \
assert(!((1U << sp->handling) & ~bitmap)); \
......
......@@ -34,6 +34,7 @@
#include <stdlib.h>
#include "cache.h"
#include "heritage.h"
#include "cache_backend.h"
#include "vrt_obj.h"
......
......@@ -29,8 +29,6 @@
* This file contains the heritage passed when mgt forks cache
*/
#include "vre.h"
struct listen_sock {
unsigned magic;
#define LISTEN_SOCK_MAGIC 0x999e4b57
......@@ -62,167 +60,6 @@ struct heritage {
char identity[1024];
};
struct params {
/* Unprivileged user / group */
char *user;
uid_t uid;
char *group;
gid_t gid;
/* TTL used for lack of anything better */
double default_ttl;
/* Default grace period */
double default_grace;
/* Default keep period */
double default_keep;
/* Maximum concurrent sessions */
unsigned max_sess;
/* Worker threads and pool */
unsigned wthread_min;
unsigned wthread_max;
unsigned wthread_timeout;
unsigned wthread_pools;
unsigned wthread_add_threshold;
unsigned wthread_add_delay;
unsigned wthread_fail_delay;
unsigned wthread_purge_delay;
unsigned wthread_stats_rate;
unsigned wthread_stacksize;
unsigned wthread_workspace;
unsigned queue_max;
/* Memory allocation hints */
unsigned sess_workspace;
unsigned shm_workspace;
unsigned http_req_size;
unsigned http_req_hdr_len;
unsigned http_resp_size;
unsigned http_resp_hdr_len;
unsigned http_max_hdr;
unsigned shm_reclen;
/* Acceptor hints */
unsigned sess_timeout;
unsigned pipe_timeout;
unsigned send_timeout;
unsigned idle_send_timeout;
/* Management hints */
unsigned auto_restart;
/* Fetcher hints */
unsigned fetch_chunksize;
unsigned fetch_maxchunksize;
unsigned nuke_limit;
#ifdef SENDFILE_WORKS
/* Sendfile object minimum size */
unsigned sendfile_threshold;
#endif
/* VCL traces */
unsigned vcl_trace;
/* Listen address */
char *listen_address;
/* Listen depth */
unsigned listen_depth;
/* CLI related */
unsigned cli_timeout;
unsigned ping_interval;
/* LRU list ordering interval */
unsigned lru_timeout;
/* Maximum restarts allowed */
unsigned max_restarts;
/* Maximum esi:include depth allowed */
unsigned max_esi_depth;
/* ESI parser hints */
unsigned esi_syntax;
/* Rush exponent */
unsigned rush_exponent;
/* Default connection_timeout */
double connect_timeout;
/* Read timeouts for backend */
double first_byte_timeout;
double between_bytes_timeout;
/* How long to linger on sessions */
unsigned session_linger;
/* CLI buffer size */
unsigned cli_buffer;
/* Control diagnostic code */
unsigned diag_bitmap;
/* Log hash string to shm */
unsigned log_hash;
/* Log local socket address to shm */
unsigned log_local_addr;
/* Prefer IPv6 connections to backend*/
unsigned prefer_ipv6;
/* Acceptable clockskew with backends */
unsigned clock_skew;
/* Expiry pacer parameters */
double expiry_sleep;
/* Acceptor pacer parameters */
double acceptor_sleep_max;
double acceptor_sleep_incr;
double acceptor_sleep_decay;
/* Get rid of duplicate bans */
unsigned ban_dups;
/* How long time does the ban lurker sleep */
double ban_lurker_sleep;
/* Max size of the saintmode list. 0 == no saint mode. */
unsigned saintmode_threshold;
unsigned syslog_cli_traffic;
unsigned http_range_support;
unsigned http_gzip_support;
unsigned gzip_stack_buffer;
unsigned gzip_tmp_space;
unsigned gzip_level;
unsigned gzip_window;
unsigned gzip_memlevel;
double critbit_cooloff;
double shortlived;
struct vre_limits vre_limits;
};
/*
* We declare this a volatile pointer, so that reads of parameters
* become atomic, leaving the CLI thread lattitude to change the values
*/
extern volatile struct params * cache_param;
extern struct heritage heritage;
void child_main(void);
......@@ -44,8 +44,9 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
#include "vapi/vsm_int.h"
#include "vbm.h"
#include "vcli.h"
......
......@@ -43,8 +43,9 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
#include "vcli.h"
#include "vcli_common.h"
#include "vcli_priv.h"
......
......@@ -38,9 +38,10 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
#include "waiter/cache_waiter.h"
#include "heritage.h"
#include "vav.h"
#include "vcli.h"
#include "vcli_common.h"
......
......@@ -48,8 +48,9 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
#include "vparam.h"
/*--------------------------------------------------------------------*/
......
......@@ -53,8 +53,8 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
/*--------------------------------------------------------------------*/
......
......@@ -98,9 +98,10 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
#include "flopen.h"
#include "heritage.h"
#include "vapi/vsc_int.h"
#include "vapi/vsl_int.h"
#include "vapi/vsm_int.h"
......
......@@ -31,37 +31,6 @@
#include "vre.h"
struct listen_sock {
unsigned magic;
#define LISTEN_SOCK_MAGIC 0x999e4b57
VTAILQ_ENTRY(listen_sock) list;
int sock;
char *name;
struct vss_addr *addr;
};
VTAILQ_HEAD(listen_sock_head, listen_sock);
struct heritage {
/* Two pipe(2)'s for CLI connection between cache and mgt. */
int cli_in;
int cli_out;
/* File descriptor for stdout/stderr */
int std_fd;
/* Sockets from which to accept connections */
struct listen_sock_head socks;
unsigned nsocks;
/* Hash method */
const struct hash_slinger *hash;
char *name;
char identity[1024];
};
struct params {
/* Unprivileged user / group */
......@@ -223,6 +192,3 @@ struct params {
* become atomic, leaving the CLI thread lattitude to change the values
*/
extern volatile struct params * cache_param;
extern struct heritage heritage;
void child_main(void);
......@@ -44,9 +44,10 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "heritage.h"
#include "params.h"
#include "hash/hash_slinger.h"
#include "heritage.h"
#include "vav.h"
#include "vcli.h"
#include "vcli_common.h"
......
......@@ -37,4 +37,3 @@ void VCC_VMOD_dir(struct vcc *, const char *str);
void VCC_Err_Unref(struct vcc *tl, unsigned u);
char *VCC_Compile(const struct vcc *, struct vsb *sb, const char *b);
const char *VCC_Return_Name(unsigned action);
......@@ -710,21 +710,6 @@ VCC_Compile(const struct vcc *tl, struct vsb *sb, const char *b)
return (r);
}
/*--------------------------------------------------------------------*/
const char *
VCC_Return_Name(unsigned method)
{
switch (method) {
#define VCL_RET_MAC(l, U, B) case VCL_RET_##U: return(#l);
#include "tbl/vcl_returns.h"
#undef VCL_RET_MAC
default:
return (NULL);
}
}
/*--------------------------------------------------------------------
* Allocate a compiler instance
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment