jgit/org.eclipse.jgit.http.server
Zhen Chen 8803718493 dump HTTP: Avoid being confused by Content-Length of a gzipped stream
TransportHttp sets 'Accept-Encoding: gzip' to allow the server to
compress HTTP responses. When fetching a loose object over HTTP, it
uses the following code to read the response:

       InputStream in = openInputStream(c);
       int len = c.getContentLength();
       return new FileStream(in, len);

If the content is gzipped, openInputStream decompresses it and produces
the correct content for the object. Unfortunately the Content-Length
header contains the length of the compressed stream instead of the
actual content length. Use a length of -1 instead since we don't know
the actual length.

Loose objects are already compressed, so the gzip encoding typically
produces a longer compressed payload. The value from the Content-Length
is too high, producing EOFException: Short read of block.

Change-Id: I8d5284dad608e3abd8217823da2b365e8cd998b0
Signed-off-by: Zhen Chen <czhen@google.com>
Helped-by: Jonathan Nieder <jrn@google.com>
2016-11-22 21:21:24 -04:00
..
.settings Change JGit minimum execution environment to JavaSE-1.8 2016-09-20 11:32:36 +02:00
META-INF Change JGit minimum execution environment to JavaSE-1.8 2016-09-20 11:32:36 +02:00
resources/org/eclipse/jgit/http/server Skip logging stack trace on corrupt objects 2015-05-06 16:02:27 -07:00
src/org/eclipse/jgit/http/server dump HTTP: Avoid being confused by Content-Length of a gzipped stream 2016-11-22 21:21:24 -04:00
.classpath Change JGit minimum execution environment to JavaSE-1.8 2016-09-20 11:32:36 +02:00
.fbprefs Simple dumb HTTP server for Git 2010-01-12 12:01:24 -08:00
.gitignore Simple dumb HTTP server for Git 2010-01-12 12:01:24 -08:00
.project Enforce the use of Java5 API:s only (with a few exceptions) 2011-12-16 01:01:36 +01:00
BUCK Implement Buck driven build 2015-12-31 10:08:55 -08:00
about.html Add missing about.html files to all shipped bundles 2011-06-08 21:51:51 +02:00
build.properties Add missing resources from source.. in build.properties 2013-10-30 17:42:38 +01:00
plugin.properties Fix plugin provider names to conform with release train requirement 2013-04-08 23:05:36 +02:00
pom.xml Prepare 4.6.0-SNAPSHOT builds 2016-09-19 17:06:42 +02:00