Req #51815 [NEW]: Add support for cURL option CURLOPT_MAX_RECV_SPEED_LARGE
From:
Operating system: all
PHP version: 5.2SVN-2010-05-13 (snap)
Package: cURL related
Bug Type: Feature/Change Request
Bug description:Add support for cURL option CURLOPT_MAX_RECV_SPEED_LARGE
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 bug report at http://bugs.php.net/bug.php?id=51815&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51815&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51815&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51815&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51815&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51815&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51815&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51815&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51815&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51815&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51815&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51815&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51815&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51815&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51815&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51815&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51815&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51815&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51815&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51815&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51815&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51815&r=mysqlcfg
Thread (2 messages)
- perryc at gmail dot com