From 091b591681044caf22747a9252f6efab462019e3 Mon Sep 17 00:00:00 2001 From: Anton Yuzhaninov Date: Mon, 3 Jun 2019 21:27:53 +0100 Subject: [PATCH] Fix build without Brotli (#5513) (#5521) --- dbms/programs/server/HTTPHandler.cpp | 2 ++ dbms/src/IO/WriteBufferFromHTTPServerResponse.cpp | 2 ++ dbms/src/IO/WriteBufferFromHTTPServerResponse.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/dbms/programs/server/HTTPHandler.cpp b/dbms/programs/server/HTTPHandler.cpp index 82f2fa3ccc9..048f175160b 100644 --- a/dbms/programs/server/HTTPHandler.cpp +++ b/dbms/programs/server/HTTPHandler.cpp @@ -312,11 +312,13 @@ void HTTPHandler::processQuery( client_supports_http_compression = true; http_response_compression_method = CompressionMethod::Zlib; } +#if USE_BROTLI else if (http_response_compression_methods == "br") { client_supports_http_compression = true; http_response_compression_method = CompressionMethod::Brotli; } +#endif } /// Client can pass a 'compress' flag in the query string. In this case the query result is diff --git a/dbms/src/IO/WriteBufferFromHTTPServerResponse.cpp b/dbms/src/IO/WriteBufferFromHTTPServerResponse.cpp index 54cff2cb837..211a46fb0f5 100644 --- a/dbms/src/IO/WriteBufferFromHTTPServerResponse.cpp +++ b/dbms/src/IO/WriteBufferFromHTTPServerResponse.cpp @@ -128,6 +128,7 @@ void WriteBufferFromHTTPServerResponse::nextImpl() deflating_buf.emplace(*out_raw, compression_method, compression_level, working_buffer.size(), working_buffer.begin()); out = &*deflating_buf; } +#if USE_BROTLI else if (compression_method == CompressionMethod::Brotli) { #if defined(POCO_CLICKHOUSE_PATCH) @@ -140,6 +141,7 @@ void WriteBufferFromHTTPServerResponse::nextImpl() brotli_buf.emplace(*out_raw, compression_level, working_buffer.size(), working_buffer.begin()); out = &*brotli_buf; } +#endif else throw Exception("Logical error: unknown compression method passed to WriteBufferFromHTTPServerResponse", diff --git a/dbms/src/IO/WriteBufferFromHTTPServerResponse.h b/dbms/src/IO/WriteBufferFromHTTPServerResponse.h index 5a7dedbc23d..0dca8fd01d9 100644 --- a/dbms/src/IO/WriteBufferFromHTTPServerResponse.h +++ b/dbms/src/IO/WriteBufferFromHTTPServerResponse.h @@ -61,7 +61,9 @@ private: std::optional out_raw; std::optional deflating_buf; +#if USE_BROTLI std::optional brotli_buf; +#endif WriteBuffer * out = nullptr; /// Uncompressed HTTP body is written to this buffer. Points to out_raw or possibly to deflating_buf.