force http 1.1 on the libcurl transport adapter (#2978)
* force http 1.1 * update wording
This commit is contained in:
parent
e0dcc20a82
commit
dcc6f12c20
@ -10,6 +10,8 @@
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
[2848](https://github.com/Azure/azure-sdk-for-cpp/issues/2848) Update the libcurl transport adapter to work with HTTP/1.1 only.
|
||||
|
||||
### Other Changes
|
||||
|
||||
## 1.2.1 (2021-09-02)
|
||||
|
||||
@ -1407,6 +1407,16 @@ std::unique_ptr<CurlNetworkConnection> CurlConnectionPool::ExtractOrCreateCurlCo
|
||||
}
|
||||
}
|
||||
|
||||
// curl-transport adapter supports only HTTP/1.1
|
||||
// https://github.com/Azure/azure-sdk-for-cpp/issues/2848
|
||||
// The libcurl uses HTTP/2 by default, if it can be negotiated with a server on handshake.
|
||||
if (!SetLibcurlOption(newHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1, &result))
|
||||
{
|
||||
throw Azure::Core::Http::TransportException(
|
||||
_detail::DefaultFailedToGetNewConnectionTemplate + host + ". Failed to set libcurl HTTP/1.1"
|
||||
+ ". " + std::string(curl_easy_strerror(result)));
|
||||
}
|
||||
|
||||
auto performResult = curl_easy_perform(newHandle);
|
||||
if (performResult != CURLE_OK)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user