Browse Source

Merge "Always close the GZIPOutputStream to release Deflater"

stable-1.3
Robin Rosenberg 13 years ago committed by Code Review
parent
commit
ef32ab428f
  1. 7
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java

7
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java

@ -101,8 +101,11 @@ class SmartOutputStream extends TemporaryBuffer {
TemporaryBuffer gzbuf = new TemporaryBuffer.Heap(LIMIT);
try {
GZIPOutputStream gzip = new GZIPOutputStream(gzbuf);
out.writeTo(gzip, null);
gzip.close();
try {
out.writeTo(gzip, null);
} finally {
gzip.close();
}
if (gzbuf.length() < out.length()) {
out = gzbuf;
rsp.setHeader(HDR_CONTENT_ENCODING, ENCODING_GZIP);

Loading…
Cancel
Save