Help on converting this V3 line to V4
Viktor Villafuerte
viktor.villafuerte at optusnet.com.au
Wed Mar 25 23:42:34 CET 2015
Hi Raymond,
> I get the following error on your first part:
>
> Message from VCC-compiler:
> 'resp.http.response': Not available in method 'vcl_backend_error'.
> At: ('input' Line 419 Pos 23)
> synthetic( {"<p>"} + resp.http.response + {"</p>"} );
> ----------------------##################--------------
vcl_error is now vcl_synth that's where you can use
resp.http.response.
in your case it would be smth more like beresp.http.response
Please see
https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html
for more details
v
On Mon 23 Mar 2015 09:43:14, Viktor Villafuerte wrote:
> Hi Raymond,
>
>
> On Thu 19 Mar 2015 10:07:01, Jennings III, Raymond wrote:
> > (1)
> > I changed vcl_error to vcl_backend_error but having a problem with the
> > internal syntax. I used to have:
> >
> > sub vcl_backend_error {
> >
> > synthetic {"<p>"} + obj.response + {"</p>"};
> > return(deliver);
> > }
>
> I'm using this like this:
> (this is from the migrate v3 to v4 page)
>
> synthetic( {"<p>"} + resp.http.response + {"</p>"} );
> return(deliver);
>
>
> >
> > (2)
> > I also had this line in my V3 vcl
> >
> > error 200 "BAN Set for " + req.url;
> >
> > Does this get converted to:
> >
> > set resp.status = 200;
> > synthetic("BAN Set for " + req.url);
> > return(deliver);
> >
> >
> > The Upgrading page says this:
> >
> > error() is now synth()
> > <https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html#error-is-now-synth>
> >
> > And you must explicitly return it:
> >
> > return (synth(999, "Response"));
> >
>
> You need to do exactly what the page says
>
> return(synth(ERR_NO, "Error message"));
>
> Then in vcl_synth you can do smth like
>
> if (resp.status == ERR_NO) {
> do_smth_here;
> }
>
>
> >
> > Not sure exactly what is going on here.
> >
> > Thanks for any insight.
> >
> > Ray
>
> > _______________________________________________
> > varnish-misc mailing list
> > varnish-misc at varnish-cache.org
> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>
> --
> Regards
>
> Viktor Villafuerte
> Optus Internet Engineering
> t: 02 808-25265
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
--
Regards
Viktor Villafuerte
Optus Internet Engineering
t: 02 808-25265
More information about the varnish-misc
mailing list