ext/curl: Refactor cURL to only use FCC#13291
Merged
Girgias merged 15 commits intophp:masterfrom May 1, 2024
Merged
Conversation
69a9320 to
294aed3
Compare
294aed3 to
2d54d26
Compare
2d54d26 to
724a2d9
Compare
ndossche
requested changes
Apr 15, 2024
724a2d9 to
c0b5fd9
Compare
ndossche
requested changes
Apr 24, 2024
Member
ndossche
left a comment
There was a problem hiding this comment.
Two minor comments otherwise looks good
| efree(mh->handlers.server_push); | ||
|
|
||
| if (ZEND_FCC_INITIALIZED(mh->handlers.server_push)) { | ||
| zend_fcc_dtor(&mh->handlers.server_push); |
Member
There was a problem hiding this comment.
In other places you set it then to the empty fcc, did you forget to do that here?
| case CURLMOPT_PUSHFUNCTION: { | ||
| /* See php_curl_set_callable_handler */ | ||
| if (ZEND_FCC_INITIALIZED(mh->handlers.server_push)) { | ||
| zend_fcc_dtor(&mh->handlers.server_push); |
Member
There was a problem hiding this comment.
Should this be set to the empty fcc?
c0b5fd9 to
9ad63b1
Compare
ndossche
approved these changes
Apr 30, 2024
Member
ndossche
left a comment
There was a problem hiding this comment.
LGTM! Thanks!
Only 2 remarks I have is one that I wrote in the comment, and one that I told you already: zend_fcc_dtor actually does set the fcc to empty, so manually overwriting to empty is not necessary (Sorry!).
TODO Tests for multi handler
9ad63b1 to
431d24a
Compare
ndossche
approved these changes
May 1, 2024
derrabus
added a commit
to symfony/symfony
that referenced
this pull request
May 3, 2024
…re-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Fix cURL default options for PHP 8.4 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT PHP 8.4 brings a change in ext/curl (php/php-src#13291) that requires `CurlResponse` to be updated. Curl callbacks cannot be set to null anymore and requires real callable. Here is (one of) the CI error it fixes: ``` 10) Symfony\Component\HttpClient\Tests\CurlHttpClientTest::testGzipBroken Failed asserting that exception of type "TypeError" matches expected exception "Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface". Message was: "curl_setopt_array(): Argument #2 ($options) must be a valid callback for option CURLOPT_PROGRESSFUNCTION, no array or string given" at /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/CurlResponse.php:175 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Internal/Canary.php:32 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php:90 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php:218 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/CommonResponseTrait.php:68 /home/runner/work/symfony/symfony/src/Symfony/Component/HttpClient/Response/CurlResponse.php:232 /home/runner/work/symfony/symfony/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php:1113 ``` Commits ------- cc0b957 [HttpClient] Fix cURL default options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor cURL options that use callables to check them on assignment and use the standard FCC instead of its custom struct.