2009-05-07
2009-05-07 14:45:40 by Stephen R. van den Berg <srb@cuci.nl>
-
ffc70911037b0d7ce7abadcf45bcce6a1433e82f
(11 lines)
(+6/-5)
[
Show
| Annotate
]
Branch: 5.2
Clean up the handling of file->encoding in HTTP_COMPRESSION mode to make sure it doesn't get messed up. Thanks to srb.
Rev: server/protocols/http.pike:1.604
2:
// Modified by Francesco Chemolli to add throttling capabilities.
// Copyright © 1996 - 2009, Roxen IS.
- constant cvs_version = "$Id: http.pike,v 1.603 2009/05/07 14:15:56 mast Exp $";
+ constant cvs_version = "$Id: http.pike,v 1.604 2009/05/07 14:45:40 marty Exp $";
// #define REQUEST_DEBUG
#define MAGIC_ERROR
2348: Inside #if defined(RAM_CACHE) and #if defined(HTTP_COMPRESSION)
#ifdef HTTP_COMPRESSION
string uncompressed = data;
string compressed;
- string encoding;
- if(!file->encoding) {
+ string encoding = file->encoding;
+ if(!encoding) {
if(compressed =
try_gzip_data(data, variant_heads["Content-Type"])) {
data = compressed;
- file->encoding = encoding = "gzip";
+ encoding = "gzip";
}
}
#endif
2378: Inside #if defined(RAM_CACHE)
"refresh":predef::time(1) +
5 + 3*misc->cacheable/4,
#ifdef HTTP_COMPRESSION
- "encoding" : file->encoding,
+ "encoding" : encoding,
#endif
]),
misc->cacheable, this_object());