[Varnish] #551: Varnish Crash: Missing errorhandling code in HSH_Prepare(), cache_hash.c line 188

Varnish varnish-bugs at projects.linpro.no
Wed Sep 16 13:50:23 CEST 2009


#551: Varnish Crash: Missing errorhandling code in HSH_Prepare(), cache_hash.c
line 188
----------------------+-----------------------------------------------------
 Reporter:  cheerios  |        Owner:  phk
     Type:  defect    |       Status:  new
 Priority:  normal    |    Milestone:     
Component:  varnishd  |      Version:  2.0
 Severity:  normal    |   Resolution:     
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment (by cheerios):

 @kristian Yes, we use ESI on every page (custom header). Here's our
 default.vcl in use. I'll look into the sess_workspace param you mentioned.

 {{{
 backend default {
 .host = "127.0.0.1";
 .port = "81";
 .first_byte_timeout = 300s;
 }

 sub vcl_recv {
         if (req.request != "GET" &&
           req.request != "HEAD" &&
           req.request != "PUT" &&
           req.request != "POST" &&
           req.request != "TRACE" &&
           req.request != "OPTIONS" &&
           req.request != "DELETE") {
                     /* Non-RFC2616 or CONNECT which is weird. */
                     pipe;
         }

         # http://varnish.projects.linpro.no/wiki/FAQ/Compression
         if (req.http.Accept-Encoding) {
                 if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
                     # No point in compressing these
                     remove req.http.Accept-Encoding;
                 } elsif (req.http.Accept-Encoding ~ "gzip") {
                     set req.http.Accept-Encoding = "gzip";
                 } elsif (req.http.Accept-Encoding ~ "deflate") {
                     set req.http.Accept-Encoding = "deflate";
                 } else {
                     # unkown algorithm
                     remove req.http.Accept-Encoding;
                 }
         }

         if (req.request != "GET" && req.request != "HEAD") {
                 pass;
         }

         if (req.http.Expect) {
                 pass;
         }

         if (req.http.Authenticate) {
                 pass;
         }

         lookup;
 }


 sub vcl_fetch {
         remove obj.http.Vary;

         if (req.request == "GET" && obj.http.Content-Type ~ "html" ) {
                 esi;
         }

         if (obj.http.Set-Cookie) {
                 pass;
         }

         if (obj.http.Pragma ~ "no-cache" || obj.http.Cache-Control ~ "no-
 cache" || obj.http.Cache-Control ~ "private") {
                 pass;
         }

         # backend tells varnish what to cache and for how long using
 Varnish-Control header
         if (obj.http.Varnish-Control) {
                 C{
                     char *ttl;
                     ttl = VRT_GetHdr(sp, HDR_OBJ, "\020Varnish-Control:");
                     VRT_l_obj_ttl(sp, atoi(ttl));
                 }C
                 remove obj.http.Cache-Control;
                 remove obj.http.Expires;
                 deliver;
         }

         if (!obj.cacheable) {
                 pass;
         }

         pass;
 }
 }}}

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/551#comment:3>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list