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