]> granicus.if.org Git - php/commitdiff
MFH
authorJani Taskinen <jani@php.net>
Wed, 17 Dec 2008 14:00:20 +0000 (14:00 +0000)
committerJani Taskinen <jani@php.net>
Wed, 17 Dec 2008 14:00:20 +0000 (14:00 +0000)
ext/curl/tests/bug45161.phpt [new file with mode: 0644]
ext/curl/tests/bug46739.phpt
ext/curl/tests/curl_002.phpt
ext/curl/tests/curl_006.phpt

diff --git a/ext/curl/tests/bug45161.phpt b/ext/curl/tests/bug45161.phpt
new file mode 100644 (file)
index 0000000..eab1fd4
--- /dev/null
@@ -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
index 4e24b2f2a25f17b097b19693e26978eda389a849..06a84ea8ed8eedc147b66f2884f3777167af2a70 100644 (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/');
index 2836c0c5351efe53f3cb9e222a31b1deae5e6bda..ed885caba2301bf0943159324333538a3c006d87 100644 (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--
index c4a6faa413d3f4d6ef59810c5d8b89dcc1aeac96..95b6331c51a716fdce6f89b5afb5fd52efa7cf8e 100755 (executable)
@@ -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)