File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 2
2
Bug #45161 (Reusing a curl handle leaks memory)
3
3
--SKIPIF--
4
4
<?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 ' ;
11
6
?>
12
7
--FILE--
13
8
<?php
9
+ include 'server.inc ' ;
10
+ $ host = curl_cli_server_start ();
14
11
15
12
// Fill memory for test
16
13
$ ch = curl_init ();
17
- $ fp = fopen ('/dev/null ' , 'w ' );
14
+ $ fp = fopen (PHP_OS_FAMILY === ' Windows ' ? ' nul ' : '/dev/null ' , 'w ' );
18
15
19
16
/*
20
17
$i = $start = $end = 100000.00;
@@ -28,7 +25,7 @@ for ($i = 0; $i < 100; $i++) {
28
25
// Start actual test
29
26
$ start = memory_get_usage () + 1024 ;
30
27
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 " );
32
29
curl_setopt ($ ch , CURLOPT_FILE , $ fp );
33
30
curl_exec ($ ch );
34
31
}
Original file line number Diff line number Diff line change 2
2
Bug #46739 (array returned by curl_getinfo should contain content_type key)
3
3
--SKIPIF--
4
4
<?php
5
- if (!extension_loaded ("curl " )) {
6
- exit ("skip curl extension not loaded " );
7
- }
5
+ include 'skipif.inc ' ;
8
6
?>
9
7
--FILE--
10
8
<?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 );
12
13
13
14
curl_exec ($ ch );
14
15
$ info = curl_getinfo ($ ch );
You can’t perform that action at this time.
0 commit comments