cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Da-Yoon Chung <dayoonc_at_andrew.cmu.edu>
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
incorrect
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.

Cheers,

-- 
Da-Yoon Chung


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2015-04-06