From 3701a327a75d35e5d0e5795341cc55bb123a2007 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 3 Jun 2013 14:20:35 -0400 Subject: [PATCH] [JENKINS-14362] Switch to jzlib for GZIP streaming. --- cli/pom.xml | 2 +- core/pom.xml | 4 ++-- core/src/main/java/hudson/FilePath.java | 6 +++--- .../main/java/hudson/console/AnnotatedLargeText.java | 4 ++-- core/src/main/java/hudson/console/ConsoleNote.java | 4 ++-- core/src/main/java/hudson/model/Run.java | 2 +- core/src/main/java/hudson/model/UsageStatistics.java | 2 +- .../security/HudsonAuthenticationEntryPoint.java | 1 - core/src/main/java/hudson/util/CompressedFile.java | 4 ++-- maven-plugin/pom.xml | 2 +- plugins/pom.xml | 10 +++++----- pom.xml | 2 +- test/pom.xml | 2 +- ui-samples-plugin/pom.xml | 2 +- war/pom.xml | 2 +- 15 files changed, 24 insertions(+), 25 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 4a8150f132..7628a16e94 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.513 + 1.513.JENKINS-14362-jzlib cli diff --git a/core/pom.xml b/core/pom.xml index 9bc3bf8525..3873845939 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.513 + 1.513.JENKINS-14362-jzlib ../pom.xml @@ -42,7 +42,7 @@ THE SOFTWARE. true - 1.207 + 1.207.JENKINS-14362-jzlib 2.5.6.SEC03 diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 3dabd48108..225f42ed34 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -92,8 +92,8 @@ import java.util.regex.Pattern; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import java.util.zip.GZIPOutputStream; -import java.util.zip.GZIPInputStream; +import com.jcraft.jzlib.GZIPInputStream; +import com.jcraft.jzlib.GZIPOutputStream; import com.sun.jna.Native; import hudson.os.PosixException; @@ -619,7 +619,7 @@ public final class FilePath implements Serializable { public InputStream extract(InputStream _in) throws IOException { HeadBufferingStream in = new HeadBufferingStream(_in,SIDE_BUFFER_SIZE); try { - return new GZIPInputStream(in,8192); + return new GZIPInputStream(in, 8192, true); } catch (IOException e) { // various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better in.fillSide(); diff --git a/core/src/main/java/hudson/console/AnnotatedLargeText.java b/core/src/main/java/hudson/console/AnnotatedLargeText.java index 1fe28f84e8..298e034bf1 100644 --- a/core/src/main/java/hudson/console/AnnotatedLargeText.java +++ b/core/src/main/java/hudson/console/AnnotatedLargeText.java @@ -51,8 +51,8 @@ import java.io.OutputStream; import java.io.Writer; import java.nio.charset.Charset; import java.security.GeneralSecurityException; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; +import com.jcraft.jzlib.GZIPInputStream; +import com.jcraft.jzlib.GZIPOutputStream; import static java.lang.Math.abs; diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index 4660193f8c..c8ea004643 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -50,8 +50,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; +import com.jcraft.jzlib.GZIPInputStream; +import com.jcraft.jzlib.GZIPOutputStream; /** * Data that hangs off from a console output. diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 5027263828..e1d944f92b 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -91,7 +91,7 @@ import java.util.Set; import java.util.HashSet; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.zip.GZIPInputStream; +import com.jcraft.jzlib.GZIPInputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; diff --git a/core/src/main/java/hudson/model/UsageStatistics.java b/core/src/main/java/hudson/model/UsageStatistics.java index 34382a3f44..2d15348670 100644 --- a/core/src/main/java/hudson/model/UsageStatistics.java +++ b/core/src/main/java/hudson/model/UsageStatistics.java @@ -59,7 +59,7 @@ import java.security.interfaces.RSAPublicKey; import java.security.spec.X509EncodedKeySpec; import java.util.ArrayList; import java.util.List; -import java.util.zip.GZIPOutputStream; +import com.jcraft.jzlib.GZIPOutputStream; /** * @author Kohsuke Kawaguchi diff --git a/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java b/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java index 6a3c21efec..f79037f4f7 100644 --- a/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java +++ b/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java @@ -42,7 +42,6 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.URLEncoder; import java.text.MessageFormat; -import java.util.zip.GZIPOutputStream; /** * For anonymous requests to pages that require authentication, diff --git a/core/src/main/java/hudson/util/CompressedFile.java b/core/src/main/java/hudson/util/CompressedFile.java index ce5afe2cb9..93c79a4d8c 100644 --- a/core/src/main/java/hudson/util/CompressedFile.java +++ b/core/src/main/java/hudson/util/CompressedFile.java @@ -40,8 +40,8 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; +import com.jcraft.jzlib.GZIPInputStream; +import com.jcraft.jzlib.GZIPOutputStream; /** * Represents write-once read-many file that can be optiionally compressed diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 63e703b332..6b49c05f7a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.513 + 1.513.JENKINS-14362-jzlib maven-plugin diff --git a/plugins/pom.xml b/plugins/pom.xml index 09ec82b8ca..a28b25d780 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -38,7 +38,7 @@ org.jenkins-ci.main maven-plugin - 1.513 + 1.513.JENKINS-14362-jzlib @@ -48,25 +48,25 @@ org.jenkins-ci.main jenkins-war war - 1.513 + 1.513.JENKINS-14362-jzlib test org.jenkins-ci.main jenkins-core - 1.513 + 1.513.JENKINS-14362-jzlib provided org.jenkins-ci.main jenkins-test-harness - 1.513 + 1.513.JENKINS-14362-jzlib test org.jenkins-ci.main ui-samples-plugin - 1.513 + 1.513.JENKINS-14362-jzlib test