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