Commit b1b2c9fd authored by Geoff Simmons's avatar Geoff Simmons

Log workspace overflow in activate().

parent 38cff6d5
varnishtest "log workspace overflow in pesi.activate()"
server s1 {
rxreq
txresp -body {<esi:include src="/include"/>}
# Include bereq never sent due to ws overflow.
} -start
varnish v1 -vcl+backend {
import ${vmod_pesi};
import ${vmod_pesi_debug};
import vtc;
include "debug.inc.vcl";
sub vcl_backend_response {
set beresp.do_esi = true;
}
sub vcl_deliver {
# Not enough left over for "pesi"
vtc.workspace_alloc(client, -3);
pesi.activate();
}
} -start
logexpect l1 -v v1 -g vxid -d 0 -q {Error ~ "^vdp pesi"} {
expect 0 * Begin {^req \d+ rxreq$}
expect * = Error {^vdp pesi: workspace overflow in activate}
} -start
client c1 {
txreq
rxresp
} -start
logexpect l1 -wait
......@@ -180,14 +180,18 @@ pesi_filter_on_ws(struct ws *ws, pesi_filter_list_t *func, void *arg)
{
struct vsb vsb[1];
const char *p;
struct req *req;
AN(func);
AN(arg);
CAST_OBJ_NOTNULL(req, arg, REQ_MAGIC);
WS_VSB_new(vsb, ws);
func(arg, vsb);
p = WS_VSB_finish(vsb, ws, NULL);
if (p == NULL)
if (p == NULL) {
p = "";
VSLb(req->vsl, SLT_Error, "vdp pesi: workspace overflow "
"in activate()");
}
return (p);
}
......
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