[Varnish] #1000: server.ip can`t beused as a string?

Varnish varnish-bugs at varnish-cache.org
Wed Aug 31 17:20:38 CEST 2011


#1000: server.ip can`t beused as a string?
-------------------------+--------------------------------------------------
  Reporter:  xrow        |        Type:  defect  
    Status:  closed      |    Priority:  normal  
 Milestone:              |   Component:  varnishd
   Version:  3.0.0       |    Severity:  normal  
Resolution:  worksforme  |    Keywords:          
-------------------------+--------------------------------------------------
Changes (by phk):

  * status:  new => closed
  * resolution:  => worksforme


Old description:

> wienadmin at slvieprodweb01:~$ sudo /etc/init.d/varnish restart
> Stopping HTTP accelerator: varnishd.
> Starting HTTP accelerator: varnishd failed!
> SMA.s0: max size 3072 MB.
> Message from VCC-compiler:
> Operator + not possible on type IP.
> ('input' Line 227 Pos 43)
>         set resp.http.X-Cache = server.ip + ":HIT:" + obj.hits;
> ------------------------------------------#--------------------
>
> Running VCC-compiler failed, exit 1
>
> VCL compilation failed
>
> -------------
> something like that was posible with 2.x

New description:

 {{{
 wienadmin at slvieprodweb01:~$ sudo /etc/init.d/varnish restart
 Stopping HTTP accelerator: varnishd.
 Starting HTTP accelerator: varnishd failed!
 SMA.s0: max size 3072 MB.
 Message from VCC-compiler:
 Operator + not possible on type IP.
 ('input' Line 227 Pos 43)
         set resp.http.X-Cache = server.ip + ":HIT:" + obj.hits;
 ------------------------------------------#--------------------

 Running VCC-compiler failed, exit 1

 VCL compilation failed
 }}}

 -------------
 something like that was posible with 2.x

--

Comment:

 This is because the VCC compiler builds expressions left to right, so
 seeing server.ip it has type "IP", then you try to add a string to that
 and it barfs.

 The workaround (see above) starts out with STRING, then adds IP, but since
 everything, including IP, can be converted to string, that works out fine.

-- 
Ticket URL: <http://www.varnish-cache.org/trac/ticket/1000#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list