From 8a078b9d71740b34b4d022900acb59a090b8d26f Mon Sep 17 00:00:00 2001 From: Sema Checherinda Date: Tue, 17 Sep 2024 16:34:18 +0200 Subject: [PATCH] fix tests --- src/Client/Connection.cpp | 27 ++----------------- .../WriteBufferFromHTTPServerResponse.cpp | 4 --- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/Client/Connection.cpp b/src/Client/Connection.cpp index cd226e315c2..927cb1a971d 100644 --- a/src/Client/Connection.cpp +++ b/src/Client/Connection.cpp @@ -355,32 +355,9 @@ void Connection::disconnect() LOG_DEBUG(getLogger("Connection::disconnect"), "begin"); in = nullptr; last_input_packet_type.reset(); - std::exception_ptr finalize_exception; - try - { - // finalize() can write and throw an exception. - if (maybe_compressed_out) - maybe_compressed_out->finalize(); - - if (out) - out->finalize(); - - if (socket) - socket->close(); - } - catch (...) - { - /// Don't throw an exception here, it will leave Connection in invalid state. - finalize_exception = std::current_exception(); - - cancel(); - } - - reset(); - - if (finalize_exception) - std::rethrow_exception(finalize_exception); + // no point to finalize tcp connections + cancel(); LOG_DEBUG(getLogger("Connection::disconnect"), "end"); } diff --git a/src/Server/HTTP/WriteBufferFromHTTPServerResponse.cpp b/src/Server/HTTP/WriteBufferFromHTTPServerResponse.cpp index 75d7711872c..09d8f0de0ca 100644 --- a/src/Server/HTTP/WriteBufferFromHTTPServerResponse.cpp +++ b/src/Server/HTTP/WriteBufferFromHTTPServerResponse.cpp @@ -45,10 +45,6 @@ void WriteBufferFromHTTPServerResponse::startSendHeaders() /// data, so "Connection: close" should be sent. response.setKeepAlive(false); } - else - { - setFixedLength(response.getContentLength()); - } if (add_cors_header) response.set("Access-Control-Allow-Origin", "*");