|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-14 08:30 UTC] pierrick@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: pierrick
[2010-05-14 08:30 UTC] pierrick@php.net
[2011-04-29 12:41 UTC] pierrick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ cURL has supported download an upload rate limiting via CURLOPT_MAX_RECV_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE for some time. Support for these options needs to be added to ext/curl/interface.c (they are simple integer values so no special support is needed, they just need to be added to the constant definitions and switch statement). Test script: --------------- <?php // create a new cURL resource $ch = curl_init(); $fh = fopen("out.dat", "w"); // set URL and other appropriate options curl_setopt($ch, CURLOPT_MAX_RECV_SPEED_LARGE, 10240); curl_setopt($ch, CURLOPT_URL, "http://bitcast-a.bitgravity.com/bitgravity/1MB"); curl_setopt($ch, CURLOPT_FILE, $fh); curl_setopt($ch, CURLOPT_HEADER, 0); // grab URL curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); fclose($fh); ?> Expected result: ---------------- Script should take at least 100 seconds to run (no matter the speed of the local internet connection). Actual result: -------------- Currently, because CURLOPT_MAX_RECV_SPEED_LARGE is not implemented in the cURL extension, the script takes as long as downloading the file over the local internet connection takes, i.e. there is no rate limiting.