cURL / Mailing Lists / curl-library / Single Mail


[PATCH] lib/transfer.c: Remove factor of 8 from sleep time

From: Da-Yoon Chung <>
Date: Mon, 6 Apr 2015 14:26:07 -0400

Hello all,

I ran into this small bug while using the CURLOPT_MAX_SEND_SPEED_LARGE
option for curl_easy_setopt. The function that calculates the amount of
time to sleep
for rate limiting purposes has an additional factor of 8, most likely an
byte-to-bit conversion because pkt_size and rate_bps are already in bytes,
so curl sleeps 8 times longer than intended and then races to catch up.

I tested the fix by using wireshark to verify the upload requests are
distributed evenly
instead of bursty afterwards in my program.


Da-Yoon Chung

List admin:

Received on 2015-04-06