Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curl keep alive #5930

Closed
wants to merge 29 commits into from
Closed
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
Prev Previous commit
Next Next commit
temp disable response reading
gearama committed Aug 23, 2024
commit cb5f4a11117a142a1b813014eb9e8f6e66096ccb
48 changes: 25 additions & 23 deletions sdk/core/azure-core/src/http/curl/curl.cpp
Original file line number Diff line number Diff line change
@@ -403,33 +403,35 @@ std::unique_ptr<RawResponse> CurlTransport::Send(Request& request, Context const
auto response = session->ExtractResponse();
// Move the ownership of the CurlSession (bodyStream) to the response
response->SetBodyStream(std::move(session));
// if the server supports keep alive the headers should be present in the response. If they are
/* // if the server supports keep alive the headers should be present in the response. If they
// are
// they should be the same as the request headers.
if (response->GetHeaders().find("Connection") != response->GetHeaders().end()
&& request.GetHeaders().find("Connection") != request.GetHeaders().end()
// just in case the server sends the connection header in a different case
&& Azure::Core::_internal::StringExtensions::ToLower(
response->GetHeaders().find("Connection")->second)
== Azure::Core::_internal::StringExtensions::ToLower(
request.GetHeaders().find("Connection")->second)
&& response->GetHeaders().find("Keep-Alive") != response->GetHeaders().end()
&& request.GetHeaders().find("Keep-Alive") != request.GetHeaders().end()
// just in case the server sends the keep-alive header in a different case
&& Azure::Core::_internal::StringExtensions::ToLower(
response->GetHeaders().find("Keep-Alive")->second)
== Azure::Core::_internal::StringExtensions::ToLower(
request.GetHeaders().find("Keep-Alive")->second))
{
Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Response has same keep-alive settings");
}
else
{
// cleanup keep-alive header in the request since they don't match up the response from the
// server.
request.RemoveHeader("Keep-Alive");
m_options.KeepAliveOptions.Reset();
}

&& request.GetHeaders().find("Keep-Alive") != request.GetHeaders().end())
{
// just in case the server sends the headers in a different case
if (Azure::Core::_internal::StringExtensions::ToLower(
response->GetHeaders().find("Connection")->second)
== Azure::Core::_internal::StringExtensions::ToLower(
request.GetHeaders().find("Connection")->second)
// just in case the server sends the keep-alive header in a different case
&& Azure::Core::_internal::StringExtensions::ToLower(
response->GetHeaders().find("Keep-Alive")->second)
== Azure::Core::_internal::StringExtensions::ToLower(
request.GetHeaders().find("Keep-Alive")->second))
{
Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Response has same keep-alive settings");
}
else
{
// cleanup keep-alive header in the request since they don't match up the response from the
// server.
request.RemoveHeader("Keep-Alive");
m_options.KeepAliveOptions.Reset();
}
}*/
return response;
}