a few difficulties with trunk

Fil fil at rezo.net
Thu Mar 3 08:48:16 CET 2011


Hi,


I wanted to try the new gzip support. My remarks so far, and a few
questions, as I haven't been able to run it yet.

Building trunk is not very easy; with the help of the irc # I was able
to finally do it though. And now I just learned about
http://repo.varnish-cache.org/snapshots/ :^)


I tried to compile my current vcl file, and got a few errors.

1. set req.http.X-Forwarded-For = (req.http.X-Forwarded-For ", " client.ip);
=> fails on '", "', Expected an action, 'if', '{' or '}'
=> OK I just learned on irc that you need a "+"

2. purge("req.http.host == " req.http.host);
=> fails on 'purge', Expected an action, 'if', '{' or '}'
=> ?

3. beresp.cacheable = false;
=> fails, can I safely replace it with beresp.ttl=0s; ?

4. set req.hash += req.http.host
=> fails, I am correct in changing it to hash_data(req.http.host) ?

5. I use a trick given by
http://open.blogs.nytimes.com/2010/09/15/using-varnish-so-news-doesnt-break-your-server/
	if (beresp.http.X-VARNISH-TTL) {
		C{
			char *ttl;
			ttl = VRT_GetHdr(sp, HDR_BERESP, "\016X-VARNISH-TTL:");
			VRT_l_beresp_ttl(sp, atoi(ttl));
		}C
		remove beresp.http.X-VARNISH-TTL;
	}

=> fails to compile:
   ./vcl.1P9zoqAU.c: In function 'VGC_function_vcl_fetch':
   ./vcl.1P9zoqAU.c:879: warning: implicit declaration of function 'atoi'


I'm currently stuck with 2 (purge) and 5 (C+atoi)

thanks

-- Fil




More information about the varnish-dev mailing list