ext-http
ext-http copied to clipboard
Potential incompatibility with `libcurl` 8.9.0+
It seems that combining this extension with libcurl 8.9.0+ breaks some functionality.
On top of a pristine Ubuntu Docker container started as docker run -it --rm ubuntu I used the following steps of reproduction:
apt update && apt install -y git libicu-dev php-dev wget zlib1g-dev
wget -qO- "https://curl.se/download/curl-8.9.0.tar.gz" | tar -zxf - -C /usr/src \
&& cd /usr/src/curl-8.9.0 \
&& ./configure --enable-versioned-symbols --with-openssl \
&& make -j \
&& make install
pecl install raphf && echo "extension=raphf.so" >> "$(php-config --ini-dir)/ext-raphf.ini"
git clone https://github.com/m6w6/ext-http.git /usr/src/ext-http \
&& cd /usr/src/ext-http \
&& phpize \
&& ./configure \
&& make -j \
&& make install \
&& echo "extension=http.so" >> "$(php-config --ini-dir)/ext-http.ini"
php -n run-tests.php tests
Eventually, the test summary is as follows:
=====================================================================
Number of tests : 203 167
Tests skipped : 36 ( 17.7%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 32 ( 15.8%) ( 19.2%)
Tests passed : 135 ( 66.5%) ( 80.8%)
---------------------------------------------------------------------
Time taken : 135 seconds
=====================================================================
With many failures sharing this common theme:
TEST 8/203 [tests/bug69357.phpt]
========DIFF========
Test
002- string(15) "HTTP/1.1 200 OK"
003- array(4) {
004- ["Accept-Ranges"]=>
005- string(5) "bytes"
006- ["Etag"]=>
007- string(10) ""%x""
008- ["X-Original-Transfer-Encoding"]=>
009- string(7) "chunked"
010- ["Content-Length"]=>
011- int(%d)
012- }
013- ===DONE===
002+
003+ Notice: http\Client::enqueue(): Could not set option interface (A libcurl function was given a bad argument) in /usr/src/ext-http/tests/bug69357.php on line 12
004+
005+ Fatal error: Uncaught Error: Call to a member function send() on null in /usr/src/ext-http/tests/bug69357.php:12
006+ Stack trace:
007+ #0 /usr/src/ext-http/tests/helper/server.inc(192): {closure}('40778', Resource id #7, Resource id #8, Resource id #9)
008+ #1 /usr/src/ext-http/tests/helper/server.inc(140): proc('/usr/bin/php8.3', Array, Object(Closure))
009+ #2 /usr/src/ext-http/tests/bug69357.php(6): server('upload.inc', Object(Closure))
010+ #3 {main}
011+ thrown in /usr/src/ext-http/tests/bug69357.php on line 12
========DONE========
FAIL Bug #69357 (HTTP/1.1 100 Continue overriding subsequent 200 response code with PUT request) [tests/bug69357.phpt]
When running the same test against libcurl 8.8.0, I get this:
=====================================================================
Number of tests : 203 167
Tests skipped : 36 ( 17.7%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 2 ( 1.0%) ( 1.2%)
Tests passed : 165 ( 81.3%) ( 98.8%)
---------------------------------------------------------------------
Time taken : 170 seconds
=====================================================================