Branch: Tag:

2010-11-10

2010-11-10 10:18:13 by Martin Jonsson <marty@roxen.com>

Fix bug where gzipped protcache entries wouldn't match If-None-Match headers. [RT #16245].

Rev: server/protocols/http.pike:1.629

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2009, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.628 2010/10/18 07:42:38 marty Exp $"; + constant cvs_version = "$Id: http.pike,v 1.629 2010/11/10 10:18:13 marty Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
3380: Inside #if defined(RAM_CACHE)
   int code = file->error;    int len = sizeof(d);    mapping(string:string) variant_heads = ([]); +  // Make sure we don't mess with the RAM cache. +  file += ([]);   #ifdef HTTP_COMPRESSION    if(file->etag)    variant_heads["ETag"] = file->etag;
3390: Inside #if defined(RAM_CACHE) and #if defined(HTTP_COMPRESSION)
   string etag = file->etag;    if(etag[sizeof(etag)-1..] == "\"")    etag = etag[..sizeof(etag)-2] + ";gzip\""; -  variant_heads["ETag"] = etag; +  file->etag = variant_heads["ETag"] = etag;    }    // Perhaps set some gzip log status here?    } else {
3399: Inside #if defined(RAM_CACHE) and #if defined(HTTP_COMPRESSION)
   }    }   #endif -  // Make sure we don't mess with the RAM cache. -  file += ([]); +     if (none_match) {    // RFC 2616, Section 14.26:    //