You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Noah Levitt (JIRA)" <ji...@apache.org> on 2012/12/29 16:54:12 UTC

[jira] [Reopened] (HTTPCLIENT-1285) InternalHttpClient.doExecute() clobbers context request config

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noah Levitt reopened HTTPCLIENT-1285:
-------------------------------------


Er well no that doesn't do it... problem is the "config = this.defaultConfig" happening so early. Here is one way to make it work as expected--

===================================================================
--- httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java	(revision 1426772)
+++ httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java	(working copy)
@@ -171,6 +171,9 @@
                 config = ((Configurable) request).getConfig();
             }
             if (config == null) {
+                config = localcontext.getRequestConfig();
+            }
+            if (config == null) {
                 config = this.defaultConfig;
             }
             if (config == null) {

                
> InternalHttpClient.doExecute() clobbers context request config
> --------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1285
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1285
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: Snapshot
>            Reporter: Noah Levitt
>             Fix For: 4.3 Alpha1
>
>
> In InternalHttpClient.doExecute() even if HttpClientContext requestConfig has been set, it gets replaced. Not sure what the intent is here as far as which config should take precedence, but if "request" doesn't provide a RequestConfig, I would certainly expect the HttpClientContext requestConfig to carry through.
>             HttpClientContext localcontext = setupContext(context);
>             HttpRoute route = determineRoute(target, wrapper, localcontext);
>             RequestConfig config = null;
>             if (request instanceof Configurable) {
>                 config = ((Configurable) request).getConfig();
>             }
>             if (config == null) {
>                 config = this.defaultConfig;
>             }
>             if (config == null) {
>                 config = HttpClientParamConfig.getRequestConfig(params);
>             }
>             localcontext.setRequestConfig(config);
> This is in trunk as of r1414680

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org