Commit 6f1c9d1a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename the "esi" action to a BOOL variable named beresp.do_esi.

In other words, you need to change
	sub vcl_fetch {
		esi;
	}

to:

	sub vcl_fetch {
		set beresp.do_esi = true;
	}

Add VCL support and skeleton versions of the gzip (beresp.do_gzip)
and gunzip (beresp.do_gunzip) VFP's while here anyway.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5713 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7e11d74a
......@@ -223,6 +223,9 @@ struct vfp {
vfp_end_f *end;
};
extern struct vfp vfp_gunzip;
extern struct vfp vfp_gzip;
/*--------------------------------------------------------------------*/
struct worker {
......@@ -268,7 +271,6 @@ struct worker {
double entered;
double ttl;
double grace;
unsigned do_esi;
/* This is only here so VRT can find it */
char *storage_hint;
......@@ -277,6 +279,9 @@ struct worker {
enum body_status body_status;
struct storage *storage;
struct vfp *vfp;
unsigned do_esi;
unsigned do_gzip;
unsigned do_gunzip;
/* Timeouts */
double connect_timeout;
......
......@@ -46,7 +46,7 @@ SVNID("$Id$")
static unsigned fetchfrag;
/*--------------------------------------------------------------------
* VFP NOOP
* VFP_NOP
*
* This fetch-processor does nothing but store the object.
* It also documents the API
......
......@@ -167,3 +167,75 @@ VGZ_Destroy(struct vgz **vg)
*vg = NULL;
return (0);
}
/*--------------------------------------------------------------------
* VFP_GUNZIP
*
* A VFP for gunzip'ing an object as we receive it from the backend
*/
static void
vfp_gunzip_begin(const struct sess *sp, size_t estimate)
{
(void)sp;
(void)estimate;
}
static int
vfp_gunzip_bytes(const struct sess *sp, struct http_conn *htc, size_t bytes)
{
(void)sp;
(void)htc;
(void)bytes;
return (-1);
}
static int
vfp_gunzip_end(const struct sess *sp)
{
(void)sp;
return (-1);
}
struct vfp vfp_gunzip = {
.begin = vfp_gunzip_begin,
.bytes = vfp_gunzip_bytes,
.end = vfp_gunzip_end,
};
/*--------------------------------------------------------------------
* VFP_GZIP
*
* A VFP for gzip'ing an object as we receive it from the backend
*/
static void
vfp_gzip_begin(const struct sess *sp, size_t estimate)
{
(void)sp;
(void)estimate;
}
static int
vfp_gzip_bytes(const struct sess *sp, struct http_conn *htc, size_t bytes)
{
(void)sp;
(void)htc;
(void)bytes;
return (-1);
}
static int
vfp_gzip_end(const struct sess *sp)
{
(void)sp;
return (-1);
}
struct vfp vfp_gzip = {
.begin = vfp_gzip_begin,
.bytes = vfp_gzip_bytes,
.end = vfp_gzip_end,
};
......@@ -377,22 +377,6 @@ VRT_Rollback(struct sess *sp)
/*--------------------------------------------------------------------*/
void
VRT_ESI(const struct sess *sp)
{
if (sp->cur_method != VCL_MET_FETCH) {
/* XXX: we should catch this at compile time */
WSP(sp, SLT_VCL_error,
"esi can only be called from vcl_fetch");
return;
}
sp->wrk->do_esi = 1;
}
/*--------------------------------------------------------------------*/
void
VRT_panic(const struct sess *sp, const char *str, ...)
{
......
......@@ -196,6 +196,9 @@ VRT_r_##dir##_##onm(const struct sess *sp) \
}
VBERESP(beresp, unsigned, cacheable, cacheable)
VBERESP(beresp, unsigned, do_esi, do_esi)
VBERESP(beresp, unsigned, do_gzip, do_gzip)
VBERESP(beresp, unsigned, do_gunzip, do_gunzip)
/*--------------------------------------------------------------------*/
......
......@@ -12,7 +12,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -15,7 +15,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start -cliok "param.set esi_syntax 4"
......
......@@ -16,7 +16,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -25,7 +25,7 @@ varnish v1 -vcl+backend {
}
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -20,7 +20,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -21,7 +21,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -32,7 +32,7 @@ varnish v1 -vcl+backend {
}
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -35,7 +35,7 @@ server s1 {
varnish v1 -storage "-smalloc,2m" -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -59,7 +59,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -23,7 +23,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -15,7 +15,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start -cli "param.set esi_syntax 2"
......
......@@ -19,7 +19,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
return(pass);
}
} -start
......
......@@ -20,7 +20,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -11,7 +11,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -13,7 +13,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -29,7 +29,7 @@ varnish v1 -vcl+backend {
if(req.url == "/") {
set req.esi = false;
}
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -34,7 +34,7 @@ varnish v1 -vcl+backend {
if(req.url == "/body") {
set req.esi = false;
}
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -74,7 +74,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -39,7 +39,7 @@ varnish v1 -vcl+backend {
return (pass);
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -16,7 +16,7 @@ server s1 {
varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -9,7 +9,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
return(pass);
}
} -start
......
......@@ -11,7 +11,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -14,7 +14,7 @@ server s1 {
varnish v1 -arg "-p diag_bitmap=0x20" -vcl+backend {
sub vcl_fetch {
if (req.url == "/") {
esi;
set beresp.do_esi = true;
}
}
} -start
......
......@@ -14,7 +14,7 @@ server s1 {
varnish v1 -arg "-p diag_bitmap=0x20" -vcl+backend {
sub vcl_fetch {
if (req.url == "/") {
esi;
set beresp.do_esi = true;
}
}
} -start
......
......@@ -27,7 +27,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -34,7 +34,7 @@ varnish v1 -vcl+backend {
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -13,7 +13,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -19,7 +19,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -21,7 +21,7 @@ varnish v1 -vcl+backend {
// return (pass);
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -cliok "param.set sess_timeout 60" -start
......
......@@ -63,7 +63,7 @@ varnish v1 -vcl+backend {
return (pass);
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -39,7 +39,7 @@ varnish v1 -vcl+backend {
return (pass);
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -start
......
......@@ -18,7 +18,7 @@ varnish v1 -vcl+backend {
// return (pass);
}
sub vcl_fetch {
esi;
set beresp.do_esi = true;
}
} -cliok "param.set sess_timeout 60" -start
......
......@@ -298,19 +298,19 @@ sp_variables = (
( 'fetch',),
'const struct sess *'
),
('beresp.esi',
('beresp.do_esi',
'BOOL',
( 'fetch',),
( 'fetch',),
'const struct sess *'
),
('beresp.gzip',
('beresp.do_gzip',
'BOOL',
( 'fetch',),
( 'fetch',),
'const struct sess *'
),
('beresp.gunzip',
('beresp.do_gunzip',
'BOOL',
( 'fetch',),
( 'fetch',),
......
......@@ -282,16 +282,6 @@ parse_ban_url(struct vcc *tl)
/*--------------------------------------------------------------------*/
static void
parse_esi(struct vcc *tl)
{
vcc_NextToken(tl);
Fb(tl, 1, "VRT_ESI(sp);\n");
}
/*--------------------------------------------------------------------*/
static void
parse_new_syntax(struct vcc *tl)
{
......@@ -402,7 +392,6 @@ static struct action_table {
/* Keep list sorted from here */
{ "call", parse_call },
{ "esi", parse_esi, VCL_MET_FETCH },
{ "hash_data", parse_hash_data, VCL_MET_HASH },
{ "panic", parse_panic },
{ "ban", parse_ban },
......
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