cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_MAX_SEND/RECV_SPEED_LARGE rate limiting issue

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 27 Nov 2010 13:35:41 -0800

On Fri, Nov 26, 2010 at 02:34:05PM -0800, Sanaz Jahanbakhsh wrote:
> I have written an application that uploads content via HTTP and need to set the upload and download limit. I'm using libcurl 7.19.7 and compiling it on Ubuntu 1004 LTS, using gcc with default flags.
> In order to set the limit I've been using the easy interface and setting download/upload speed by passing the parameter read from user.
> Using GDB I debugged the code and found out that limit I'm setting is being passed down properly however only certain limits work.
> For example when I'm uploading a 10MiB file and setting the limit to the exact same size, I see the rate being effective and see an upload speed of 10MiB per second. However if I set the limit to any value between 2 to 10 times the file size, the smaller limit is being applied. I've tested this with various file sizes ranging from 1KiB to 100 MiB and see the same behaviour regardless of the file size.
> Going over the email archives I've tried compiling my code with -D_FILE_OFFSET_BITS set to 64 to ensure datatype mismatches would not affect the operation.
> I'd appreciate it if you could let me know if you've experienced the same issue and how to set the upload/download limit.
>
> Any help is greatly appreciated,

I don't believe this is a known issue. It's possible that some kind of
overflow is occurring in the library when you're specifying those large rate
limits--they're typically one or two orders of magnitude greater than what
I imagine are typically-set values. Are you sure it's not just a measurement
error? Keep in mind that the rate limit is calculated only once per second.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-27