xref: /PHP-8.0/ext/curl/tests/bug68937_2.phpt (revision 75a04eac)
1--TEST--
2Bug # #68937 (Segfault in curl_multi_exec)
3--SKIPIF--
4<?php
5include 'skipif.inc';
6?>
7--FILE--
8<?php
9include 'server.inc';
10$host = curl_cli_server_start();
11
12$url = "{$host}/get.inc";
13
14$ch = curl_init($url);
15curl_setopt_array($ch, array(
16    CURLOPT_HEADER => false,
17    CURLOPT_RETURNTRANSFER => true,
18    CURLOPT_POST => true,
19    CURLOPT_INFILESIZE => filesize(__FILE__),
20    CURLOPT_INFILE => fopen(__FILE__, 'r'),
21    CURLOPT_HTTPHEADER => array(
22        'Expect:',
23        'Content-Length: 1',
24    ),
25    CURLOPT_READFUNCTION => 'curl_read',
26    CURLOPT_CONNECTTIMEOUT => 1,
27    CURLOPT_TIMEOUT => 1
28));
29
30function curl_read($ch, $fp, $len) {
31    var_dump($fp);
32    exit;
33}
34
35curl_exec($ch);
36curl_close($ch);
37?>
38--EXPECTF--
39resource(%d) of type (stream)
40