aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-10-11 10:42:53 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-10-11 10:42:53 +0200
commit19ea85ef12ada79d19f4661c5966f57730c80dfc (patch)
tree7844fe645bc68c2b12070d40bce6f2420d8f4da3
parent37bc50d90551a2580f7762d8527e76663fddab20 (diff)
downloadpaccache-19ea85ef12ada79d19f4661c5966f57730c80dfc.tar.gz
paccache-19ea85ef12ada79d19f4661c5966f57730c80dfc.tar.zst
throttle requests
-rw-r--r--pacredir.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pacredir.c b/pacredir.c
index 0241586..49d3265 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -386,6 +386,10 @@ static int ahc_echo(void * cls,
break;
}
+ /* throttle requests - do not send all request at the same time
+ * but wait for a short moment (10.000 us = 0.01 s) */
+ usleep(10000);
+
/* This is multi-threading code!
* Pointer to struct request does not work as realloc can relocate the data.
* We need a pointer to pointer to struct request, store the addresses in