Files
munki/code
Justin McWilliams 79cec41552 Fix CPU owning for curl downloads while on slow internet connections when Content-Length header is not present.
App Engine Blobstore does not send Content-Type, which means targetsize is always 0 and therefore the conditional that calculates and reports download progress is never entered, and the existing sleep location is never hit. On slow internet connections, this means that CPU spikes as proc.poll() is being called far more than curl is downloading.

Fix this by moving time.sleep(0.1) into the main curl while loop, where it'll execute on every loop iteration. That means we have a small sleep even while headers are downloading/etc, but that's not a big deal given it's a 1/10th of a second.
2011-09-15 18:39:49 -04:00
..