Req #51815 [Opn->Csd]: Add support for cURL option CURLOPT_MAX_RECV_SPEED_LARGE
| From: | pierrick@php.net | Date: | Fri, 14 May 2010 06:30:12 +0000 |
| Subject: | Req #51815 [Opn->Csd]: Add support for cURL option CURLOPT_MAX_RECV_SPEED_LARGE | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150451@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51815&edit=1
ID: 51815
Updated by: pierrick@php.net
Reported by: perryc at gmail dot com
Summary: Add support for cURL option
CURLOPT_MAX_RECV_SPEED_LARGE
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: cURL related
Operating System: all
PHP Version: 5.2SVN-2010-05-13 (snap)
-Assigned To:
+Assigned To: pierrick
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2010-05-13 23:13:48] perryc at gmail dot com
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51815&edit=1