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

ppconsul with HTTP/2 #74

Open
kolomparrudi opened this issue Jun 21, 2022 · 0 comments
Open

ppconsul with HTTP/2 #74

kolomparrudi opened this issue Jun 21, 2022 · 0 comments

Comments

@kolomparrudi
Copy link

Hi,

We have upgraded libcurl and now it supports HTTP/2 protocol.
After the upgrade ppconsul fails if I try to loads keys or items with BadException.
The reason of the failure is the HTTP response did not match with http/2 response (HTTP/2 200).

As a short term solution I made this small change to force HTTP 1.1:

--- a/src/curl/http_client.cpp
+++ b/src/curl/http_client.cpp
@@ -80,6 +80,7 @@ namespace ppconsul { namespace curl {

         size_t headerCallback(char *ptr, size_t size_, size_t nitems, void *outputResponse_)
         {
+
             const auto size = size_ * nitems;
             auto outputResponse = reinterpret_cast<CurlHttpClient::GetResponse *>(outputResponse_);

@@ -236,6 +237,7 @@ namespace ppconsul { namespace curl {
             setopt(CURLOPT_SSL_VERIFYSTATUS, 1l);
 #endif
         }
+        setopt(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
     }

     CurlHttpClient::~CurlHttpClient() = default;

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant