fix #2466. Avoid caching half fetched files
commit9ae1a5d1c95492cdaecdb208f9458ec5aab71baa
authorAndreas Gohr <andi@splitbrain.org>
Fri, 17 Aug 2018 08:21:20 +0000 (17 10:21 +0200)
committerAndreas Gohr <andi@splitbrain.org>
Fri, 17 Aug 2018 08:21:20 +0000 (17 10:21 +0200)
tree2673e2ea594b50d4ae7148b85bf2eaf37177bd62
parent30bea1b90629d99b72a227f92561493c6ae0bafc
fix #2466. Avoid caching half fetched files

When a remote resource exceeds the fetchsize but the remote server does
not return a Content-Length, we read only the fetchsize amount of bytes
but failed to detect that this was a partial read, thus a partial
resource got cached.

This fix will read fetchsize+1, which will then be correctly determined
as too big and thrown away.
inc/HTTPClient.php