Bug #77624 [NEW]: curl_getinfo() returns bad or empty entries for responses pushed via HTTP/2

From: Date: Fri, 15 Feb 2019 12:19:57 +0000
Subject: Bug #77624 [NEW]: curl_getinfo() returns bad or empty entries for responses pushed via HTTP/2
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219592@lists.php.net to get a copy of this message
From:             nicolas dot grekas+php at gmail dot com
Operating system: 
PHP version:      7.3Git-2019-02-15 (Git)
Package:          cURL related
Bug Type:         Bug
Bug description:curl_getinfo() returns bad or empty entries for responses pushed via HTTP/2

Description:
------------
When calling curl_getinfo() on a pushed curl handle, the resulting
entries return bad timing info, bad URL, empty primary_ip, etc.

Test script:
---------------
$mh = curl_multi_init();

curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, $onPush = function ($p,
$c, $h) {
    return CURL_PUSH_OK;
});

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://http2-push.io');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_multi_add_handle($mh, $ch);

do {
    while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($mh, $active));

    while ($info = curl_multi_info_read($mh)) {
        print_r(curl_getinfo($info['handle']));
    }

    if (-1 === curl_multi_select($mh)) {
        usleep(1000);
    }
} while ($active);


Expected result:
----------------
entry "url" should be set to the pushed URL
entry "primary_ip" should be set to the pushing server IP
entry "starttransfer_time" should return plausible value
etc.

Actual result:
--------------
entry "url" is set to the URL of the parent response
entry "primary_ip" is empty
entry "starttransfer_time" is 0.0 or some impossible (more than 1M
seconds)
etc.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=77624&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77624&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77624&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77624&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77624&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77624&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77624&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77624&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77624&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77624&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77624&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77624&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77624&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77624&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77624&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77624&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77624&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77624&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77624&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77624&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77624&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#219592) next »