|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51815 Add support for cURL option CURLOPT_MAX_RECV_SPEED_LARGE
Submitted: 2010-05-13 23:13 UTC Modified: 2010-05-14 08:30 UTC
From: perryc at gmail dot com Assigned: pierrick
Status: Closed Package: cURL related
PHP Version: 5.2SVN-2010-05-13 (snap) OS: all
Private report: No CVE-ID:
 [2010-05-13 23:13 UTC] perryc at gmail dot com
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:

// 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, "");
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL

// close cURL resource, and free up system resources

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-14 08:30 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: pierrick
 [2010-05-14 08:30 UTC]
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
Thank you for the report, and for helping us make PHP better.

 [2011-04-29 12:41 UTC]
Automatic comment from SVN on behalf of pierrick
# MFH. This addition was already committed to trunk and is backported as requested in #54622
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 12:01:29 2015 UTC