Error compiling VCL with trunk (r2043)
Martin Aspeli
optilude at gmx.net
Wed Sep 26 01:22:39 CEST 2007
Hi,
This may be a known issue (couldn't find anything in trac), but with the
VCL pasted below and trunk as of right now (r2043), I get this error
trying to start Varnish:
System error:
C-compiler command complained.
Command attempted: exec /bin/sh -c "exec cc -nostdinc -fpic -shared
-Wl,-x -o ./bin.XXo1HaX1 -x c - < ./vcl.XXo1HaX1" 2>&1
Message:
<stdin>: In function `VGC_Init':
<stdin>:906: warning: passing arg 1 of `VRT_acl_init' discards
qualifiers from pointer target type
<stdin>: In function `VGC_Fini':
<stdin>:917: warning: passing arg 1 of `VRT_acl_fini' discards
qualifiers from pointer target type
Reverting to r1979 (for no reason other than that this worked for me
previously) makes it work again.
The VCL:
backend backend_0 {
set backend.host = "127.0.0.1";
set backend.port = "8000";
}
acl purge {
"localhost";
}
sub vcl_recv {
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
lookup;
}
if (req.request != "GET" && req.request != "HEAD") {
pipe;
}
if (req.http.Expect) {
pipe;
}
if (req.http.If-None-Match) {
pass;
}
/* Do not cache other authorised content */
if (req.http.Authenticate || req.http.Authorization) {
pass;
}
/* We only care about the "__ac.*" cookies, used for authentication */
if (req.http.Cookie && (req.http.Cookie ~
"__ac(_(name|password|persistent))?=" || req.http.Cookie ~ "_ZopeId")) {
pass;
}
lookup;
}
/* Deal with purge requests */
sub vcl_hit {
if (req.request == "PURGE") {
set obj.ttl = 0s;
error 200 "Purged";
}
}
sub vcl_miss {
if (req.http.If-Modified-Since) {
pass;
}
if (req.request == "PURGE") {
error 404 "Not in cache";
}
}
sub vcl_fetch {
if (!obj.valid) {
error;
}
if (!obj.cacheable) {
pass;
}
if (obj.http.Set-Cookie) {
pass;
}
if (req.url ~ "(rss_|search_rss)") {
set obj.ttl = 1800s;
}
}
sub vcl_hash {
set req.hash += req.http.Accept-Encoding;
}
--
Acquisition is a jealous mistress
More information about the varnish-misc
mailing list