jani            Wed Dec 17 13:59:47 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/curl/tests     bug45161.phpt 
  Log:
  MFH
  

http://cvs.php.net/viewvc.cgi/php-src/ext/curl/tests/bug45161.phpt?view=markup&rev=1.1
Index: php-src/ext/curl/tests/bug45161.phpt
+++ php-src/ext/curl/tests/bug45161.phpt
--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



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to