Download src/php/php-src/ext/curl/tests/bug45161.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 792 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/curl/tests/bug45161.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/curl/tests/bug45161.phpt
-
curl -L -o bug45161.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/curl/tests/bug45161.phpt
792 Bytes
| --TEST-- | |
| Bug #45161 (Reusing a curl handle leaks memory) | |
| --EXTENSIONS-- | |
| curl | |
| --FILE-- | |
| include 'server.inc'; | |
| $host = curl_cli_server_start(); | |
| // Fill memory for test | |
| $ch = curl_init(); | |
| $fp = fopen(PHP_OS_FAMILY === 'Windows' ? 'nul' : '/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, "{$host}/get.inc"); | |
| 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 | |