Branch: Tag:

2010-10-08

2010-10-08 15:54:09 by Martin Jonsson <marty@roxen.com>

Make sure the source file has the methods we need in GzStreamingFile before
setting up streaming compression. Fixes [Bug 5740 (#5740)].

Rev: server/protocols/http.pike:1.626

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2009, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.625 2010/09/02 16:03:40 marty Exp $"; + constant cvs_version = "$Id: http.pike,v 1.626 2010/10/08 15:54:09 marty Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
2386: Inside #if defined(HTTP_COMPRESSION) and #if defined(HTTP_COMPR_STREAM)
   return sprintf("%1c%1c%1c%1c%4c%1c%1c",    0x1f, 0x8b, 8, 0, 0, 0, 3);    } +  +  string _sprintf() +  { +  return sprintf ("GzStreamingFile (%O)", srcfile);    } -  + }   #endif      private int(0..1) compression_enabled_for_mimetype (string mimetype)
2468: Inside #if defined(HTTP_COMPRESSION)
   }    }   #ifdef HTTP_COMPR_STREAM -  else if (objectp (data)) { +  else if (objectp (data) && functionp (data->read) && +  functionp (data->tell)) {    return GzStreamingFile (data, conf->query ("http_compression_level"));    }   #endif