hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1682713 - in /httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client: config/RequestConfig.java protocol/ResponseContentEncoding.java
Date Sun, 31 May 2015 10:46:04 GMT
Author: olegk
Date: Sun May 31 10:46:03 2015
New Revision: 1682713

URL: http://svn.apache.org/r1682713
Log:
HTTPCLIENT-1654: better backward compatibility

Modified:
    httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
    httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java?rev=1682713&r1=1682712&r2=1682713&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
Sun May 31 10:46:03 2015
@@ -58,14 +58,13 @@ public class RequestConfig implements Cl
     private final int connectionRequestTimeout;
     private final int connectTimeout;
     private final int socketTimeout;
-    private final boolean decompressionEnabled;
     private final boolean contentCompressionEnabled;
 
     /**
      * Intended for CDI compatibility
     */
     protected RequestConfig() {
-        this(false, null, null, false, null, false, false, false, 0, false, null, null, 0,
0, 0, false, false);
+        this(false, null, null, false, null, false, false, false, 0, false, null, null, 0,
0, 0, true);
     }
 
     RequestConfig(
@@ -84,7 +83,6 @@ public class RequestConfig implements Cl
             final int connectionRequestTimeout,
             final int connectTimeout,
             final int socketTimeout,
-            final boolean decompressionEnabled,
             final boolean contentCompressionEnabled) {
         super();
         this.expectContinueEnabled = expectContinueEnabled;
@@ -102,7 +100,6 @@ public class RequestConfig implements Cl
         this.connectionRequestTimeout = connectionRequestTimeout;
         this.connectTimeout = connectTimeout;
         this.socketTimeout = socketTimeout;
-        this.decompressionEnabled = decompressionEnabled;
         this.contentCompressionEnabled = contentCompressionEnabled;
     }
 
@@ -319,7 +316,7 @@ public class RequestConfig implements Cl
      */
     @Deprecated
     public boolean isDecompressionEnabled() {
-        return decompressionEnabled;
+        return contentCompressionEnabled;
     }
 
     /**
@@ -357,7 +354,6 @@ public class RequestConfig implements Cl
         builder.append(", connectionRequestTimeout=").append(connectionRequestTimeout);
         builder.append(", connectTimeout=").append(connectTimeout);
         builder.append(", socketTimeout=").append(socketTimeout);
-        builder.append(", decompressionEnabled=").append(decompressionEnabled);
         builder.append(", contentCompressionEnabled=").append(contentCompressionEnabled);
         builder.append("]");
         return builder.toString();
@@ -406,7 +402,6 @@ public class RequestConfig implements Cl
         private int connectionRequestTimeout;
         private int connectTimeout;
         private int socketTimeout;
-        private boolean decompressionEnabled;
         private boolean contentCompressionEnabled;
 
         Builder() {
@@ -419,7 +414,6 @@ public class RequestConfig implements Cl
             this.connectionRequestTimeout = -1;
             this.connectTimeout = -1;
             this.socketTimeout = -1;
-            this.decompressionEnabled = true;
             this.contentCompressionEnabled = true;
         }
 
@@ -509,7 +503,7 @@ public class RequestConfig implements Cl
          */
         @Deprecated
         public Builder setDecompressionEnabled(final boolean decompressionEnabled) {
-            this.decompressionEnabled = decompressionEnabled;
+            this.contentCompressionEnabled = decompressionEnabled;
             return this;
         }
 
@@ -535,7 +529,6 @@ public class RequestConfig implements Cl
                     connectionRequestTimeout,
                     connectTimeout,
                     socketTimeout,
-                    decompressionEnabled,
                     contentCompressionEnabled);
         }
 

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java?rev=1682713&r1=1682712&r2=1682713&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
Sun May 31 10:46:03 2015
@@ -129,7 +129,7 @@ public class ResponseContentEncoding imp
         final RequestConfig requestConfig = clientContext.getRequestConfig();
         // entity can be null in case of 304 Not Modified, 204 No Content or similar
         // check for zero length entity.
-        if (requestConfig.isDecompressionEnabled() && entity != null && entity.getContentLength()
!= 0) {
+        if (requestConfig.isContentCompressionEnabled() && entity != null &&
entity.getContentLength() != 0) {
             final Header ceheader = entity.getContentEncoding();
             if (ceheader != null) {
                 final HeaderElement[] codecs = ceheader.getElements();



Mime
View raw message