Skip to content

Commit fabe6aa

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78090: bug45161.phpt takes forever to finish
2 parents f00afae + a0c93bf commit fabe6aa

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

ext/curl/tests/bug45161.phpt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
Bug #45161 (Reusing a curl handle leaks memory)
33
--SKIPIF--
44
<?php
5-
if (substr(PHP_OS, 0, 3) == 'WIN') {
6-
exit("skip not for Windows");
7-
}
8-
if (!extension_loaded("curl")) {
9-
exit("skip curl extension not loaded");
10-
}
5+
include 'skipif.inc';
116
?>
127
--FILE--
138
<?php
9+
include 'server.inc';
10+
$host = curl_cli_server_start();
1411

1512
// Fill memory for test
1613
$ch = curl_init();
17-
$fp = fopen('/dev/null', 'w');
14+
$fp = fopen(PHP_OS_FAMILY === 'Windows' ? 'nul' : '/dev/null', 'w');
1815

1916
/*
2017
$i = $start = $end = 100000.00;
@@ -28,7 +25,7 @@ for ($i = 0; $i < 100; $i++) {
2825
// Start actual test
2926
$start = memory_get_usage() + 1024;
3027
for($i = 0; $i < 1024; $i++) {
31-
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
28+
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc");
3229
curl_setopt($ch, CURLOPT_FILE, $fp);
3330
curl_exec($ch);
3431
}

ext/curl/tests/bug46739.phpt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
Bug #46739 (array returned by curl_getinfo should contain content_type key)
33
--SKIPIF--
44
<?php
5-
if (!extension_loaded("curl")) {
6-
exit("skip curl extension not loaded");
7-
}
5+
include 'skipif.inc';
86
?>
97
--FILE--
108
<?php
11-
$ch = curl_init('http://127.0.0.1:9/');
9+
include 'server.inc';
10+
$host = curl_cli_server_start();
11+
$ch = curl_init("{$host}/get.inc");
12+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1213

1314
curl_exec($ch);
1415
$info = curl_getinfo($ch);

0 commit comments

Comments
 (0)