Skip to content

Incorrect comment for CURL_HTTP_VERSION_3 #519

Closed

Description

@jcamiel

To use HTTP 3 we can use the following code:

self.handle.http_version(HttpVersion::V3);

HttpVersion::V3 is defined as as
https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/src/easy/handler.rs#L455-L465

And curl_sys::CURL_HTTP_VERSION_3 is defined here:

https://github.com/alexcrichton/curl-rust/blob/ff6ad21cc1034826b2ab3f8be0653d8c446e1bdc/curl-sys/lib.rs#L663-L665

The comment of this flag states that

Makes use of explicit HTTP/3 without fallback.

Whereas in curl.h the corresponding flag is defined

https://github.com/curl/curl/blob/9bca45dba81d77de06757ce13fc9193e09e010b5/include/curl/curl.h#L2272-L2274

/* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
needed. For HTTPS only. For HTTP, this option
makes libcurl return error. */

libcurl seems to fallback when using this flag whereas comments in crates curl imply that there is no fallback...

Activity

  1. sagebind commented on Aug 8, 2023

    @sagebind
    Owner

    Our doc comment was lifted straight from the libcurl man page, but it looks like it actually changed behaviors in version 7.88 when CURL_HTTP_VERSION_3ONLY was added: curl/curl@a56d2b0. When we initially added this, CURL_HTTP_VERSION_3 didn't allow any fallback.

    But we can update this now. Maybe worth noting in the doc comment that the behavior varies between version >=7.66,<7.88 and >=7.88, depending on which version of libcurl you are linked to.

  2. jcamiel commented on Aug 9, 2023

    @jcamiel
    ContributorAuthor

    I can propose a PR with an updated comment if that help,

  3. jcamiel commented on Aug 10, 2023

    @jcamiel
    ContributorAuthor

    PR here => #521 (relevant curl PR is curl/curl#10264)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions