File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #45161 (Reusing a curl handle leaks memory)
3
+ --FILE--
4
+ <?php
5
+
6
+ // Fill memory for test
7
+ $ ch = curl_init ();
8
+ $ fp = fopen ('/dev/null ' , 'w ' );
9
+
10
+ /*
11
+ $i = $start = $end = 100000.00;
12
+ for ($i = 0; $i < 100; $i++) {
13
+ curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
14
+ curl_setopt($ch, CURLOPT_FILE, $fp);
15
+ curl_exec($ch);
16
+ }
17
+ */
18
+
19
+ // Start actual test
20
+ $ start = memory_get_usage () + 1024 ;
21
+ for ($ i = 0 ; $ i < 1024 ; $ i ++) {
22
+ curl_setopt ($ ch , CURLOPT_URL , 'http://127.0.0.1:9/ ' );
23
+ curl_setopt ($ ch , CURLOPT_FILE , $ fp );
24
+ curl_exec ($ ch );
25
+ }
26
+ if ($ start < memory_get_usage ()) {
27
+ echo 'FAIL ' ;
28
+ } else {
29
+ echo 'PASS ' ;
30
+ }
31
+ echo "\n" ;
32
+ fclose ($ fp );
33
+ unset($ fp );
34
+ ?>
35
+ --EXPECT--
36
+ PASS
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #46739 (array returned by curl_getinfo should contain content_type key)
3
+ --FILE--
4
+ <?php
5
+ $ ch = curl_init ('http://127.0.0.1:9/ ' );
6
+
7
+ curl_exec ($ ch );
8
+ $ info = curl_getinfo ($ ch );
9
+
10
+ echo (array_key_exists ('content_type ' , $ info )) ? "set " : "not set " ;
11
+ ?>
12
+ --EXPECT--
13
+ set
You can’t perform that action at this time.
0 commit comments