Skip to content

Curl: Add CURL_HTTP_VERSION_3 constant #12543

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

Closed
wants to merge 1 commit into from
Closed

Conversation

Ayesh
Copy link
Member

@Ayesh Ayesh commented Oct 28, 2023

Declares the CURL_HTTP_VERSION_3 (libcurl >= 7.66), along with the arginfo updates.

We already have CURL_VERSION_HTTP3 constant declared. However, there are not the same. CURL_HTTP_VERSION_3 (int 30) is one of the CURLOPT_HTTP_VERSION options, while CURL_VERSION_HTTP3 is the feature flag bitmask.

None of the default repos include libcurl with HTTP/3 support enabled, but I could manually get it to work by compiling libcurl with nghttp3, ngtcp2, and patched openssl. Without this patch, it is still possible to make HTTP/3 requests with curl_setopt($ch, CURLOPT_HTTP_VERSION, 30);. This patch merely declares the constant for the parity.

Considering we already declare CURL_VERSION_HTTP3 feature-flag constant (since PHP 8.2), I think the lack of CURL_HTTP_VERSION_3 constant is a bit odd. Both constants were declared in the same upstream version (7.66). Also taking it into consideration the rapid HTTP/3 adoption, I would like to request to consider bringing this change to PHP-8.3 branch as well, although we are only a single release candidate behind the first GA.

Declares the `CURL_HTTP_VERSION_3`, along with the arginfo updates.

This should be supported in Curl 7.66 and later, and we already have
`CURL_VERSION_HTTP3` constant declared. However, there are not the same.

`CURL_HTTP_VERSION_3` (int 30) is one of the `CURLOPT_HTTP_VERSION` options,
while `CURL_VERSION_HTTP3` is the feature flag bitmask.

`CURL_VERSION_HTTP3` is declared since PHP 8.2.
@Ayesh Ayesh requested a review from adoy as a code owner October 28, 2023 09:07
Ayesh added a commit to Ayesh/php-src that referenced this pull request Oct 28, 2023
 - Updates the URL of Curl constant page from `https://curl.haxx.se/libcurl/c/symbols-in-versions.html`
   to `https://curl.se/libcurl/c/symbols-in-versions.html`.

 - Fixes the regex used to filter constants to match `CURL_HTTP` constants.

Related: php#12543
@Girgias
Copy link
Member

Girgias commented Oct 28, 2023

@bukka for the cURL constants.

Girgias pushed a commit that referenced this pull request Oct 28, 2023
- Updates the URL of Curl constant page from `https://curl.haxx.se/libcurl/c/symbols-in-versions.html`
   to `https://curl.se/libcurl/c/symbols-in-versions.html`.

 - Fixes the regex used to filter constants to match `CURL_HTTP` constants.

Related: GH-12543
Copy link
Contributor

@GrahamCampbell GrahamCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not a duplicate of #12000?

@Ayesh
Copy link
Member Author

Ayesh commented Oct 29, 2023

Apparently it is @GrahamCampbell, I will close this. Apologies about the noise.

@Ayesh Ayesh closed this Oct 29, 2023
@Ayesh Ayesh deleted the curl-http3 branch October 29, 2023 22:33
Ayesh added a commit to Ayesh/php-src that referenced this pull request Aug 11, 2024
This intends to supersede the two following PRs:
 - php#12000 because it does not modify the stub file, but only update the
   arginfo file. It also proposes to merge to GA branches, and is
   currently marked as Requires RM Approval.
 - php#12543 Essentially the same as this PR and from the same author, as
   this, but its about a year old and requires rebasing anyway.

This adds the `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY`
constants on relevant versions (7.66 and 7.88 respectively).

It is possible to use HTTP/3 without having these constants declared,
but having them declared in PHP makes things more approachable and
"official".
Ayesh added a commit to Ayesh/php-src that referenced this pull request Aug 12, 2024
This intends to supersede the two following PRs:
 - php#12000 because it does not modify the stub file, but only update the
   arginfo file. It also proposes to merge to GA branches, and is
   currently marked as Requires RM Approval.
 - php#12543 Essentially the same as this PR and from the same author, as
   this, but its about a year old and requires rebasing anyway.

This adds the `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY`
constants on relevant versions (7.66 and 7.88 respectively).

It is possible to use HTTP/3 without having these constants declared,
but having them declared in PHP makes things more approachable and
"official".
Girgias pushed a commit that referenced this pull request Aug 12, 2024
This intends to supersede the two following PRs:
 - #12000 because it does not modify the stub file, but only update the
   arginfo file. It also proposes to merge to GA branches, and is
   currently marked as Requires RM Approval.
 - #12543 Essentially the same as this PR and from the same author, as
   this, but its about a year old and requires rebasing anyway.

This adds the `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY`
constants on relevant versions (7.66 and 7.88 respectively).

It is possible to use HTTP/3 without having these constants declared,
but having them declared in PHP makes things more approachable and
"official".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants