diff --git a/src/nhttpd/yhttpd_core/yconnection.cpp b/src/nhttpd/yhttpd_core/yconnection.cpp index ea16280b5..ea36c0c7c 100644 --- a/src/nhttpd/yhttpd_core/yconnection.cpp +++ b/src/nhttpd/yhttpd_core/yconnection.cpp @@ -96,10 +96,9 @@ void CWebserverConnection::HandleConnection() { if(string_tolower(Request.HeaderList["Connection"]) == "close" || (httprotocol != "HTTP/1.1" && string_tolower(Request.HeaderList["Connection"]) != "keep-alive") || !Webserver->CheckKeepAliveAllowedByIP(sock->get_client_ip())) - keep_alive = false; -#else - keep_alive = false; #endif + keep_alive = false; + // Send a response Response.SendResponse(); diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 9246edec8..3b789864f 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -248,9 +248,8 @@ std::string CyhookHandler::BuildHeader(bool cache) { break; } // print Status-line - result = string_printf(HTTP_PROTOCOL " %d %s\r\nContent-Type: %s\r\n",httpStatus, responseString, ResponseMimeType.c_str()); - log_level_printf(2, "Response: HTTP/1.1 %d %s\r\nContent-Type: %s\r\n", - httpStatus, responseString, ResponseMimeType.c_str()); + result = string_printf(HTTP_PROTOCOL " %d %s\r\nContent-Type: %s\r\n", httpStatus, responseString, ResponseMimeType.c_str()); + log_level_printf(2, "Response: HTTP/1.1 %d %s\r\nContent-Type: %s\r\n", httpStatus, responseString, ResponseMimeType.c_str()); switch (httpStatus) { case HTTP_UNAUTHORIZED: @@ -285,7 +284,7 @@ std::string CyhookHandler::BuildHeader(bool cache) { // connection type #ifdef Y_CONFIG_FEATURE_KEEP_ALIVE if(keep_alive) - result += "Connection: keep-alive\r\n"; + result += "Connection: keep-alive\r\n"; else #endif result += "Connection: close\r\n";