hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1430867 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java
Date Wed, 09 Jan 2013 14:12:12 GMT
Author: olegk
Date: Wed Jan  9 14:12:11 2013
New Revision: 1430867

URL: http://svn.apache.org/viewvc?rev=1430867&view=rev
Log:
Small tweaks to MinimalHttpClient

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

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java?rev=1430867&r1=1430866&r2=1430867&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java
Wed Jan  9 14:12:11 2013
@@ -79,12 +79,6 @@ class MinimalHttpClient extends Closeabl
         this.params = new BasicHttpParams();
     }
 
-    private HttpClientContext setupContext(final HttpContext localContext) {
-        HttpClientContext context = HttpClientContext.adapt(
-                localContext != null ? localContext : new BasicHttpContext());
-        return context;
-    }
-
     @Override
     protected CloseableHttpResponse doExecute(
             final HttpHost target,
@@ -98,20 +92,16 @@ class MinimalHttpClient extends Closeabl
         }
         try {
             HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(request);
-            HttpClientContext localcontext = setupContext(context);
+            HttpClientContext localcontext = HttpClientContext.adapt(
+                context != null ? context : new BasicHttpContext());
             HttpRoute route = new HttpRoute(target);
             RequestConfig config = null;
             if (request instanceof Configurable) {
                 config = ((Configurable) request).getConfig();
             }
-            if (config == null) {
-                config = RequestConfig.DEFAULT;
-            }
-            if (config.getProxy() != null) {
-                throw new ClientProtocolException("Minimal HttpClient does not support" +
-                " request execution via proxy");
+            if (config != null) {
+                localcontext.setRequestConfig(config);
             }
-            localcontext.setRequestConfig(config);
             return this.requestExecutor.execute(route, wrapper, localcontext, execAware);
         } catch (HttpException httpException) {
             throw new ClientProtocolException(httpException);



Mime
View raw message