Mercurial > hg > orthanc
diff Core/HttpServer/HttpOutput.h @ 1517:4f8c8ef114db
cont
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Aug 2015 10:32:34 +0200 |
parents | 7962563129c9 |
children | 8bd0d897763f |
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.h Tue Aug 11 08:53:47 2015 +0200 +++ b/Core/HttpServer/HttpOutput.h Tue Aug 11 10:32:34 2015 +0200 @@ -109,12 +109,38 @@ }; StateMachine stateMachine_; + bool isDeflateAllowed_; + bool isGzipAllowed_; + + HttpCompression GetPreferredCompression(size_t bodySize) const; public: HttpOutput(IHttpOutputStream& stream, bool isKeepAlive) : - stateMachine_(stream, isKeepAlive) + stateMachine_(stream, isKeepAlive), + isDeflateAllowed_(false), + isGzipAllowed_(false) + { + } + + void SetDeflateAllowed(bool allowed) { + isDeflateAllowed_ = allowed; + } + + bool IsDeflateAllowed() const + { + return isDeflateAllowed_; + } + + void SetGzipAllowed(bool allowed) + { + isGzipAllowed_ = allowed; + } + + bool IsGzipAllowed() const + { + return isGzipAllowed_; } void SendStatus(HttpStatus status); @@ -147,11 +173,9 @@ } void SendBody(const void* buffer, - size_t length, - HttpCompression compression = HttpCompression_None); + size_t length); - void SendBody(const std::string& str, - HttpCompression compression = HttpCompression_None); + void SendBody(const std::string& str); void SendBody();