-
Notifications
You must be signed in to change notification settings - Fork 7.8k
ext/curl: Refactor cURL to only use FCC #13291
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
Conversation
69a9320
to
294aed3
Compare
294aed3
to
2d54d26
Compare
2d54d26
to
724a2d9
Compare
724a2d9
to
c0b5fd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be set to the empty fcc?
c0b5fd9
to
9ad63b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
…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
Refactor cURL options that use callables to check them on assignment and use the standard FCC instead of its custom struct.