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

Wrong version in curl config? #130

Closed
ryangooch opened this issue Jun 4, 2024 · 2 comments
Closed

Wrong version in curl config? #130

ryangooch opened this issue Jun 4, 2024 · 2 comments

Comments

@ryangooch
Copy link

I stumbled upon this while looking for something else. It looks like the code intends for the use of the HTTP/2 protocol, based on the comment, but I believe that the code is actually specifying HTTP/1.1.

    # force http/2 for all products
    httr::set_config(httr::config(http_version = 2))

Link:

ecmwfr/R/zzz.R

Line 142 in 534e988

httr::set_config(httr::config(http_version = 2))

Somewhat confusingly, it seems the curl uses an enum for specifying that http_version argument. My read could be wrong, but the curl headers source code indicates that the value of 2 corresponds to HTTP/1.1, while a value of 3 would indicate HTTP/2.

I've been tracking this issue in an unrelated project, and I am by no means a curl expert. I do have some experience with numerical weather prediction, though, which is part of what caught my eye when I saw a search hit for this line in your code.

@khufkens
Copy link
Member

This is the version which "works". The comment might not be correct in this sense. I would leave as is unless strong counter indications.

@ryangooch
Copy link
Author

Sounds good. In my experience, using HTTP/1.1 is less prone to weird curl errors, among other fail cases, so doing what works and using the simpler method, as you say, is better.

The comment and the unintuitive enumeration caught my eye so I just wanted to share what I'd learned at what has most recently bitten me 😅 and try to prevent it biting someone else.

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

2 participants