Show
Ignore:
Timestamp:
12/09/08 14:54:09 (20 months ago)
Author:
phk
Message:

Add support for, and use a new syntax for terminating actions in VCL,
basically "return(action)" instead of just "action".

The previos syntax is still available.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/varnish-cache/bin/varnishd/default.vcl

    r3324 r3460  
    4949      req.request != "DELETE") { 
    5050        /* Non-RFC2616 or CONNECT which is weird. */ 
    51         pipe; 
     51        return (pipe); 
    5252    } 
    5353    if (req.request != "GET" && req.request != "HEAD") { 
    5454        /* We only deal with GET and HEAD by default */ 
    55         pass; 
     55        return (pass); 
    5656    } 
    5757    if (req.http.Authorization || req.http.Cookie) { 
    5858        /* Not cacheable by default */ 
    59         pass; 
     59        return (pass); 
    6060    } 
    61     lookup; 
     61    return (lookup); 
    6262} 
    6363 
    6464sub vcl_pipe { 
    65     pipe; 
     65    return (pipe); 
    6666} 
    6767 
    6868sub vcl_pass { 
    69     pass; 
     69    return (pass); 
    7070} 
    7171 
     
    7777        set req.hash += server.ip; 
    7878    } 
    79     hash; 
     79    return (hash); 
    8080} 
    8181 
    8282sub vcl_hit { 
    8383    if (!obj.cacheable) { 
    84         pass; 
     84        return (pass); 
    8585    } 
    86     deliver; 
     86    return (deliver); 
    8787} 
    8888 
    8989sub vcl_miss { 
    90     fetch; 
     90    return (fetch); 
    9191} 
    9292 
    9393sub vcl_fetch { 
    9494    if (!obj.cacheable) { 
    95         pass; 
     95        return (pass); 
    9696    } 
    9797    if (obj.http.Set-Cookie) { 
    98         pass; 
     98        return (pass); 
    9999    } 
    100100    set obj.prefetch =  -30s; 
    101     deliver; 
     101    return (deliver); 
    102102} 
    103103 
    104104sub vcl_deliver { 
    105     deliver; 
     105    return (deliver); 
    106106} 
    107107 
    108108sub vcl_discard { 
    109109    /* XXX: Do not redefine vcl_discard{}, it is not yet supported */ 
    110     discard; 
     110    return (discard); 
    111111} 
    112112 
    113113sub vcl_prefetch { 
    114114    /* XXX: Do not redefine vcl_prefetch{}, it is not yet supported */ 
    115     fetch; 
     115    return (fetch); 
    116116} 
    117117 
    118118sub vcl_timeout { 
    119119    /* XXX: Do not redefine vcl_timeout{}, it is not yet supported */ 
    120     discard; 
     120    return (discard); 
    121121} 
    122122 
     
    142142</html> 
    143143"}; 
    144     deliver; 
     144    return (deliver); 
    145145}