From c40dae940e30d51e2731f9e27a10278e3580b194 Mon Sep 17 00:00:00 2001 From: Konstantin Bogdanov Date: Fri, 13 Sep 2024 18:40:28 +0200 Subject: [PATCH] temp-commit --- src/Server/HTTPHandler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Server/HTTPHandler.cpp b/src/Server/HTTPHandler.cpp index eead407f5d9..cad2cd9d9cb 100644 --- a/src/Server/HTTPHandler.cpp +++ b/src/Server/HTTPHandler.cpp @@ -542,7 +542,7 @@ void HTTPHandler::processQuery( applyHTTPResponseHeaders(response, http_response_headers_override); - auto set_query_result = [&response, this] (const QueryResultDetails & details) + auto set_query_result = [&response, &used_output, this] (const QueryResultDetails & details) { response.add("X-ClickHouse-Query-Id", details.query_id); @@ -555,6 +555,10 @@ void HTTPHandler::processQuery( if (details.timezone) response.add("X-ClickHouse-Timezone", *details.timezone); + + /// Start sending headers early, as it requires access to the internal + /// WriteBuffer, which may also be used concurrently by compressing wrapper. + used_output.out_holder->startSendHeadersPublic(); }; auto handle_exception_in_output_format = [&](IOutputFormat & current_output_format, const String & format_name, const ContextPtr & context_, const std::optional & format_settings) @@ -587,10 +591,6 @@ void HTTPHandler::processQuery( } }; - /// Start sending headers early, as it requires access to the internal - /// WriteBuffer, which may also be used concurrently by compressing wrapper. - used_output.out_holder->startSendHeadersPublic(); - executeQuery( *in, *used_output.out_maybe_delayed_and_compressed,