From cbda315af3b25156c2ecb3cc863688cca447de3b Mon Sep 17 00:00:00 2001 From: volpol Date: Tue, 8 Sep 2020 15:34:06 +0200 Subject: [PATCH] Tweaked bw_hint yet again... --- curly.c | 3 ++- itemq.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/curly.c b/curly.c index 9537f77..fe5c553 100644 --- a/curly.c +++ b/curly.c @@ -37,7 +37,8 @@ void curly_set_bw_hint(int kbps, int adj){ //round to the nearest 100K // bw_hint = (((kbps/8)+5000)/10000)*10000; //or not; - bw_hint = (adj<<10)+(kbps>>3); //adjust to have a little leeway + //bw_hint = (adj<<10)+(kbps>>3); //adjust to have a little leeway + bw_hint = (kbps >> 3) + (adj << 7); usd = 998 * ((650 * 16) / (bw_hint >> 10)); printf ("bw hint set to %lu kB/s (usleep: %lu)\n", bw_hint>>10, usd); } diff --git a/itemq.c b/itemq.c index 080ee89..2725779 100644 --- a/itemq.c +++ b/itemq.c @@ -373,7 +373,7 @@ const char *choose_url(void){ printf ("Final BW: %d | URL: %s\n", bw, u); if (!config.disable_bwhint) - curly_set_bw_hint(bw, 333); //at least 333 + curly_set_bw_hint(bw, 100); //curly_set_bw_hint(bw, ((bw>>13) / 2)); //increase max by 50% return u; -- 2.30.2