1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00
This commit is contained in:
Jani Taskinen
2008-12-17 14:00:20 +00:00
parent 7156227045
commit 3ce9e6d6d9
4 changed files with 40 additions and 4 deletions
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #45161 (Reusing a curl handle leaks memory)
--FILE--
<?php
// Fill memory for test
$ch = curl_init();
$fp = fopen('/dev/null', 'w');
/*
$i = $start = $end = 100000.00;
for ($i = 0; $i < 100; $i++) {
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
}
*/
// Start actual test
$start = memory_get_usage() + 1024;
for($i = 0; $i < 1024; $i++) {
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
}
if ($start < memory_get_usage()) {
echo 'FAIL';
} else {
echo 'PASS';
}
echo "\n";
fclose($fp);
unset($fp);
?>
--EXPECT--
PASS
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Test bug #46739
Bug #46739 (array returned by curl_getinfo should contain content_type key)
--FILE--
<?php
$ch = curl_init('http://127.0.0.1:9/');
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Test curl_opt() function with CURLOPT_RETURNTRANSFER paremter set to 1
Test curl_opt() function with CURLOPT_RETURNTRANSFER parameter set to 1
--CREDITS--
Sebastian Deutsch <sebastian.deutsch@9elements.com>
--SKIPIF--
+2 -2
View File
@@ -1,7 +1,7 @@
--TEST--
Test curl_opt() function with CURLOPT_WRITEFUNCTION paremter set to a closure
Test curl_opt() function with CURLOPT_WRITEFUNCTION parameter set to a closure
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv(b'PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)