Commit b6ec427f authored by Per Buer's avatar Per Buer
parents 4600acfb 089a3352
......@@ -62,12 +62,6 @@ struct vdi_simple {
const struct vrt_backend *vrt;
};
/*
* List of cached vbcs, used if enabled in params/heritage
*/
static VTAILQ_HEAD(,vbc) vbcs = VTAILQ_HEAD_INITIALIZER(vbcs);
/*--------------------------------------------------------------------
* Create default Host: header for backend request
*/
......@@ -97,17 +91,10 @@ VBE_ReleaseConn(struct vbc *vc)
vc->addr = NULL;
vc->addrlen = 0;
vc->recycled = 0;
if (params->cache_vbcs) {
Lck_Lock(&VBE_mtx);
VTAILQ_INSERT_HEAD(&vbcs, vc, list);
VSC_main->backend_unused++;
Lck_Unlock(&VBE_mtx);
} else {
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc--;
Lck_Unlock(&VBE_mtx);
free(vc);
}
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc--;
Lck_Unlock(&VBE_mtx);
FREE_OBJ(vc);
}
#define FIND_TMO(tmx, dst, sp, be) \
......@@ -238,21 +225,8 @@ vbe_NewConn(void)
{
struct vbc *vc;
vc = VTAILQ_FIRST(&vbcs);
if (vc != NULL) {
Lck_Lock(&VBE_mtx);
vc = VTAILQ_FIRST(&vbcs);
if (vc != NULL) {
VSC_main->backend_unused--;
VTAILQ_REMOVE(&vbcs, vc, list);
}
Lck_Unlock(&VBE_mtx);
}
if (vc != NULL)
return (vc);
vc = calloc(sizeof *vc, 1);
ALLOC_OBJ(vc, VBC_MAGIC);
XXXAN(vc);
vc->magic = VBC_MAGIC;
vc->fd = -1;
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc++;
......
......@@ -55,6 +55,10 @@ ved_include(struct sess *sp, const char *src, const char *host)
w = sp->wrk;
if (sp->esi_level >= params->max_esi_depth)
return;
sp->esi_level++;
if (WRW_Flush(w)) {
vca_close_session(sp, "remote closed");
return;
......@@ -62,7 +66,6 @@ ved_include(struct sess *sp, const char *src, const char *host)
AZ(WRW_FlushRelease(w));
sp->esi_level++;
obj = sp->obj;
sp->obj = NULL;
res_mode = sp->wrk->res_mode;
......
......@@ -310,8 +310,8 @@ vfp_esi_begin(struct sess *sp, size_t estimate)
VEP_Init(sp, NULL);
} else if (sp->wrk->is_gunzip && sp->wrk->do_gzip) {
ALLOC_OBJ(vef, VEF_MAGIC);
AN(vef);
//vef = (void*)WS_Alloc(sp->ws, sizeof *vef);
//AN(vef);
//memset(vef, 0, sizeof *vef);
//vef->magic = VEF_MAGIC;
vef->vgz = VGZ_NewGzip(sp, "G F E");
......@@ -321,8 +321,8 @@ vfp_esi_begin(struct sess *sp, size_t estimate)
} else if (sp->wrk->is_gzip) {
sp->wrk->vgz_rx = VGZ_NewUngzip(sp, "U F E");
ALLOC_OBJ(vef, VEF_MAGIC);
AN(vef);
//vef = (void*)WS_Alloc(sp->ws, sizeof *vef);
//AN(vef);
//memset(vef, 0, sizeof *vef);
//vef->magic = VEF_MAGIC;
vef->vgz = VGZ_NewGzip(sp, "G F E");
......
......@@ -123,7 +123,7 @@ VRT_Vmod_Fini(void **hdl)
if (--v->ref != 0)
return;
#ifndef DONT_DLCLOSE_VMODS
dlclose(v->hdl);
AZ(dlclose(v->hdl));
#endif
free(v->nm);
free(v->path);
......
......@@ -136,7 +136,7 @@ struct params {
unsigned max_restarts;
/* Maximum esi:include depth allowed */
unsigned max_esi_includes;
unsigned max_esi_depth;
/* ESI parser hints */
unsigned esi_syntax;
......@@ -144,9 +144,6 @@ struct params {
/* Rush exponent */
unsigned rush_exponent;
/* Cache vbcs */
unsigned cache_vbcs;
/* Default connection_timeout */
double connect_timeout;
......
......@@ -483,6 +483,10 @@ tweak_diag_bitmap(struct cli *cli, const struct parspec *par, const char *arg)
"this parameter, or if the default value is even sensible. " \
"Caution is advised, and feedback is most welcome."
#define WIZARD_TEXT \
"\nNB: Do not change this parameter, unless a developer tell " \
"you to do so."
/*
* Remember to update varnishd.1 whenever you add / remove a parameter or
* change its default value.
......@@ -647,15 +651,11 @@ static const struct parspec input_parspec[] = {
"Use 0x notation and do the bitor in your head :-)\n",
0,
"0", "bitmap" },
{ "max_esi_includes",
tweak_uint, &master.max_esi_includes, 0, UINT_MAX,
{ "max_esi_depth",
tweak_uint, &master.max_esi_depth, 0, UINT_MAX,
"Maximum depth of esi:include processing.\n",
0,
"5", "includes" },
{ "cache_vbcs", tweak_bool, &master.cache_vbcs, 0, 0,
"Cache vbc's or rely on malloc, that's the question.",
EXPERIMENTAL,
"off", "bool" },
"5", "levels" },
{ "connect_timeout", tweak_timeout_double,
&master.connect_timeout,0, UINT_MAX,
"Default connection timeout for backend connections. "
......@@ -664,7 +664,7 @@ static const struct parspec input_parspec[] = {
"VCL can override this default value for each backend and "
"backend request.",
0,
"0.4", "s" },
"0.7", "s" },
{ "first_byte_timeout", tweak_timeout_double,
&master.first_byte_timeout,0, UINT_MAX,
"Default timeout for receiving first byte from backend. "
......@@ -748,9 +748,9 @@ static const struct parspec input_parspec[] = {
0,
"8192", "bytes" },
{ "log_hashstring", tweak_bool, &master.log_hash, 0, 0,
"Log the hash string to shared memory log.\n",
"Log the hash string components to shared memory log.\n",
0,
"off", "bool" },
"on", "bool" },
{ "log_local_address", tweak_bool, &master.log_local_addr, 0, 0,
"Log the local address on the TCP connection in the "
"SessionOpen shared memory record.\n",
......@@ -812,7 +812,7 @@ static const struct parspec input_parspec[] = {
{ "http_range_support", tweak_bool, &master.http_range_support, 0, 0,
"Enable support for HTTP Range headers.\n",
EXPERIMENTAL,
"off", "bool" },
"on", "bool" },
{ "http_gzip_support", tweak_bool, &master.http_gzip_support, 0, 0,
"Enable gzip support. When enabled Varnish will compress "
"uncompressed objects before they are stored in the cache. "
......@@ -862,7 +862,7 @@ static const struct parspec input_parspec[] = {
&master.critbit_cooloff, 60, 254,
"How long time the critbit hasher keeps deleted objheads "
"on the cooloff list.\n",
EXPERIMENTAL,
WIZARD,
"180.0", "s" },
{ "vcl_dir", tweak_string, &mgt_vcl_dir, 0, 0,
"Directory from which relative VCL filenames (vcl.load and "
......@@ -958,6 +958,8 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
mcf_wrap(cli, MUST_RELOAD_TEXT);
if (pp->flags & MUST_RESTART)
mcf_wrap(cli, MUST_RESTART_TEXT);
if (pp->flags & WIZARD)
mcf_wrap(cli, WIZARD_TEXT);
if (!lfmt)
return;
else
......
......@@ -41,10 +41,11 @@ struct parspec {
double max;
const char *descr;
int flags;
#define DELAYED_EFFECT 1
#define EXPERIMENTAL 2
#define MUST_RESTART 4
#define MUST_RELOAD 8
#define DELAYED_EFFECT (1<<0)
#define EXPERIMENTAL (1<<1)
#define MUST_RESTART (1<<2)
#define MUST_RELOAD (1<<3)
#define WIZARD (1<<4)
const char *def;
const char *units;
};
......
......@@ -9,6 +9,7 @@ server s1 {
varnish v1 -vcl+backend {
} -start
varnish v1 -cliok "param.set http_range_support off"
client c1 {
txreq -hdr "Range: bytes=0-9"
......
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