GS Cache: extracting large number of files.

We use "range request" to extract files. When using pattern, we don't
know how many files matched. If they are too many, say > 700, we cannot
set all ranges in one single request because our caching server may
response 400 error that request header too long.

In this case, we split the ranges into chunks, say 100 range per chunk,
and send them to caching server one chunk per request.

BUG=chromium:824580
TEST=Ran unit tests.

Change-Id: If1adafcae96ddcb4c9ec1319411ae3298fa6397d
Reviewed-on: https://chromium-review.googlesource.com/1107104
Commit-Ready: Congbin Guo <guocb@chromium.org>
Tested-by: Congbin Guo <guocb@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
2 files changed