hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1426771 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
Date Sat, 29 Dec 2012 15:28:05 GMT
Author: olegk
Date: Sat Dec 29 15:28:04 2012
New Revision: 1426771

URL: http://svn.apache.org/viewvc?rev=1426771&view=rev
Log:
HTTPCLIENT-1285: request configuration in the context to remain unchanged if not explicitly
overridden by the request

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java?rev=1426771&r1=1426770&r2=1426771&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
Sat Dec 29 15:28:04 2012
@@ -30,6 +30,7 @@ package org.apache.http.impl.client;
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.logging.Log;
@@ -87,7 +88,7 @@ class InternalHttpClient extends Closeab
     private final CredentialsProvider credentialsProvider;
     private final RequestConfig defaultConfig;
     private final List<Closeable> closeables;
-    private final HttpParams params;
+    private final BasicHttpParams params;
 
     public InternalHttpClient(
             final ClientExecChain execChain,
@@ -173,9 +174,14 @@ class InternalHttpClient extends Closeab
                 config = this.defaultConfig;
             }
             if (config == null) {
-                config = HttpClientParamConfig.getRequestConfig(params);
+                Set<String> names = params.getNames();
+                if (!names.isEmpty()) {
+                    config = HttpClientParamConfig.getRequestConfig(params);
+                }
+            }
+            if (config != null) {
+                localcontext.setRequestConfig(config);
             }
-            localcontext.setRequestConfig(config);
             return this.execChain.execute(route, wrapper, localcontext, execAware);
         } catch (HttpException httpException) {
             throw new ClientProtocolException(httpException);



Mime
View raw message