call a sub function and return

Daniel Bruessler mail at danielbruessler.de
Wed Oct 14 16:39:55 CEST 2009


Hello,

I don't need a "return" to return a value, I just want to jump out
before the end of the function. I posted a simplified version of my
function, the real one has several if-clauses.

Cheers!
Daniel

>> Hi!
>>
>> I'd like to call a sub function and use the return-function. But is
>> there a return-function?
>>
>> #called from vcl_fetch: call vcl_custom_cachingtime;
>> sub vcl_custom_cachingtimes {
>>
>>    if (req.url ~ "^/abc/*" {
>>        set obj.ttl = 10m;
>>        #return (0);
>>    }
>>
>>    if (req.url ~ "^/def/*" {
>>        set obj.ttl = 30s;
>>    }
>>
>> }
> 
> It's not clear from you example what you would use the return for,
> but you can simulate it, but putting you return value in a header
> instead
> 




More information about the varnish-misc mailing list