Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions runtime-light/server/http/init-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,13 @@ std::string_view process_headers(const tl::K2InvokeHttp& invoke_http, PhpScriptB
http_server_instance_st.encoding |= HttpServerInstanceState::ENCODING_DEFLATE;
}
} else if (h_name == kphp::http::headers::CONNECTION) {
if (h_value == CONNECTION_KEEP_ALIVE) [[likely]] {
auto iequals{[](std::string_view s1, std::string_view s2) noexcept {
Comment thread
apolyakov marked this conversation as resolved.
Outdated
return std::ranges::equal(s1, s2, [](char a, char b) { return std::tolower(a, std::locale::classic()) == std::tolower(b, std::locale::classic()); });
}};

if (iequals(h_value, CONNECTION_KEEP_ALIVE)) [[likely]] {
http_server_instance_st.connection_kind = kphp::http::connection_kind::keep_alive;
} else if (h_value == CONNECTION_CLOSE) [[likely]] {
} else if (iequals(h_value, CONNECTION_CLOSE)) [[likely]] {
http_server_instance_st.connection_kind = kphp::http::connection_kind::close;
} else {
kphp::log::error("unexpected connection header: {}", h_value);
Expand Down
Loading