# HG changeset patch # User Sebastien Jodogne # Date 1439282165 -7200 # Node ID eb46cc06389a1c2d01ee0c5f898b015735df7f13 # Parent 4f8c8ef114dba419490fc61afba8afd15368a43d cont diff -r 4f8c8ef114db -r eb46cc06389a Core/HttpServer/MongooseServer.cpp --- a/Core/HttpServer/MongooseServer.cpp Tue Aug 11 10:32:34 2015 +0200 +++ b/Core/HttpServer/MongooseServer.cpp Tue Aug 11 10:36:05 2015 +0200 @@ -980,6 +980,7 @@ { Stop(); httpCompression_ = enabled; + LOG(WARNING) << "HTTP compression is " << (enabled ? "enabled" : "disabled"); } void MongooseServer::SetIncomingHttpRequestFilter(IIncomingHttpRequestFilter& filter) diff -r 4f8c8ef114db -r eb46cc06389a Core/RestApi/RestApiOutput.cpp --- a/Core/RestApi/RestApiOutput.cpp Tue Aug 11 10:32:34 2015 +0200 +++ b/Core/RestApi/RestApiOutput.cpp Tue Aug 11 10:36:05 2015 +0200 @@ -45,8 +45,6 @@ HttpMethod method) : output_(output), method_(method), - allowDeflateCompression_(false), - allowGzipCompression_(false), convertJsonToXml_(false) { alreadySent_ = false; @@ -80,32 +78,6 @@ } - HttpCompression RestApiOutput::GetPreferredCompression(size_t bodySize) const - { -#if 0 - // TODO - if (bodySize < 1024) - { - // Do not compress small answers - return HttpCompression_None; - } -#endif - - if (allowGzipCompression_) - { - return HttpCompression_Gzip; - } - else if (allowDeflateCompression_) - { - return HttpCompression_Deflate; - } - else - { - return HttpCompression_None; - } - } - - void RestApiOutput::AnswerFile(HttpFileSender& sender) { CheckStatus(); diff -r 4f8c8ef114db -r eb46cc06389a Core/RestApi/RestApiOutput.h --- a/Core/RestApi/RestApiOutput.h Tue Aug 11 10:32:34 2015 +0200 +++ b/Core/RestApi/RestApiOutput.h Tue Aug 11 10:36:05 2015 +0200 @@ -44,15 +44,11 @@ private: HttpOutput& output_; HttpMethod method_; - bool allowDeflateCompression_; - bool allowGzipCompression_; bool alreadySent_; bool convertJsonToXml_; void CheckStatus(); - HttpCompression GetPreferredCompression(size_t bodySize) const; - public: RestApiOutput(HttpOutput& output, HttpMethod method); @@ -79,16 +75,6 @@ return convertJsonToXml_; } - void AllowDeflateCompression(bool allow) - { - allowDeflateCompression_ = allow; - } - - void AllowGzipCompression(bool allow) - { - allowGzipCompression_ = allow; - } - void AnswerFile(HttpFileSender& sender); void AnswerJson(const Json::Value& value);