Commit f2604159 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a read-only beresp.filters variable which doesn't return that yet.

parent 12610fd5
......@@ -388,6 +388,7 @@ struct busyobj {
struct worker *wrk;
struct vfp_ctx *vfc;
char *filter_list;
struct ws ws[1];
uintptr_t ws_bo;
......
......@@ -36,6 +36,7 @@
#include "common/heritage.h"
#include "vcl.h"
#include "vct.h"
#include "cache_director.h"
#include "vrt_obj.h"
......@@ -913,3 +914,26 @@ HTTP_VAR(req)
HTTP_VAR(resp)
HTTP_VAR(bereq)
HTTP_VAR(beresp)
/*--------------------------------------------------------------------*/
VCL_STRING
VRT_r_beresp_filters(VRT_CTX)
{
const char *p;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
if (ctx->bo->filter_list != NULL)
return(ctx->bo->filter_list);
#if 1
p = "Not Yet";
#else
p = VBF_Get_Filter_List(ctx->bo);
WS_Release(ctx->bo->ws, strlen(p) + 1);
#endif
while(vct_isspace(*p))
p++;
return (p);
}
......@@ -72,7 +72,7 @@ process p4 -need-bytes 310 -expect-text 3 1 "line3 <"
process p4 -expect-cursor 4 1
process p4 -expect-cursor 4 0
process p4 -expect-cursor 0 1
process p4 -screen-dump
process p4 -screen-dump
# Also exercise CONS25 mode
process p4 -write "\x1b[=1T"
......
......@@ -37,7 +37,9 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.http.filter1 = beresp.filters;
set beresp.do_esi = true;
set beresp.http.filter2 = beresp.filters;
}
} -start
......
......@@ -36,12 +36,14 @@ server s1 {
varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
sub vcl_backend_response {
set beresp.http.filters1 = beresp.filters;
set beresp.do_esi = true;
if (bereq.url ~ "/baz") {
set beresp.do_gzip = true;
} elif (bereq.url ~ "/foo(bar|baz|qux)") {
set beresp.do_gunzip = true;
}
set beresp.http.filters2 = beresp.filters;
}
} -start
......
......@@ -895,6 +895,14 @@ beresp.storage_hint ``VCL <= 4.0``
Hint to Varnish that you want to save this object to a
particular storage backend.
beresp.filters
Type: STRING
Readable from: vcl_backend_response
List of VFP filters the beresp.body will be pulled through.
obj
~~~
......
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