-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix #76675 - Leave a reference to the resource in the curl handle #3744
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
I'm getting a segfault when running the added test case:
|
I'm not being able to reproduce the segfault. Can you tell me the versions of curl and nghttp2 you have installed? |
@pmmaga This is my
|
@nikic The segfault seems caused by curl itself, upgrading it to >=7.61 should fix the issue. |
Merged as 32ae716. I've added a SKIPIF for curl < 7.61. |
Hm.. I created a docker image and complied PHP to test this PR. However, I failed to make it work... In fact, I failed to make any curl requests.. When I base my image on alpine:3.4 I get curl version 7.60.0 and I can make normal curl requests as expected. When I base my image on apline:3.6 I get curl version 7.61.1. I cannot reproduce the output of the test in this PR nor can I make any normal curl request...
See https://github.com/Nyholm/php-test-server-push It is likely that I'm doing something very wrong, but I just wanted to report my findings (or incompetence) =) |
Hi @Nyholm. For curl to support http2 it needs to be built with libnghttp2. This seems to be the case on alpine >=3.8. Based on the dockerfile of your repo, switching the base image to |
Ah, Okey, thank you. How can I, from a PHP library, figure out if the current runtime has http2 support or not? I know I can check PHP and curl version but how do I check if it is built with libnghttp2? |
Would that do it?: |
Actually, there is another bug here: if I add |
Link for bugsnet: https://bugs.php.net/bug.php?id=76675
curl_write
andcurl_write_header
expect the curl handle to have the reference to their resource set. Currently, the handles returned by_php_server_push_callback
miss them.