Tweaked bw_hint yet again...
authorvolpol <volpol@packet-gain.de>
Tue, 8 Sep 2020 13:34:06 +0000 (15:34 +0200)
committervolpol <volpol@packet-gain.de>
Wed, 9 Sep 2020 18:24:11 +0000 (20:24 +0200)
curly.c
itemq.c

diff --git a/curly.c b/curly.c
index 9537f77c08c79ebafbe22fa2ca98c74b1a551efc..fe5c55324d695d7ed6141ca4d1db59db5aeff72e 100644 (file)
--- 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 080ee8927f58b297d3ff56434e68f0df5125c965..27257794a956f141e860663c5b338c693d039d72 100644 (file)
--- 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;