Diff of /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java
Parent Directory
| Revision Log
| Patch
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java 2005/05/12 17:01:17 169848
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java 2005/05/12 17:05:07 169849
@@ -353,7 +353,7 @@ public class HttpClient {
* {@link HostConfiguration host configuration} with the given custom
* {@link HttpState HTTP state}.
*
- * @param hostConfiguration The {@link HostConfiguration host configuration} to use.
+ * @param hostconfig The {@link HostConfiguration host configuration} to use.
* @param method the {@link HttpMethod HTTP method} to execute.
* @param state the {@link HttpState HTTP state} to use when executing the method.
* If <code>null</code>, the state returned by {@link #getState} will be used instead.
@@ -366,7 +366,7 @@ public class HttpClient {
* cannot be recovered from.
* @since 2.0
*/
- public int executeMethod(HostConfiguration hostConfiguration,
+ public int executeMethod(HostConfiguration hostconfig,
final HttpMethod method, final HttpState state)
throws IOException, HttpException {
@@ -376,18 +376,21 @@ public class HttpClient {
throw new IllegalArgumentException("HttpMethod parameter may not be null");
}
HostConfiguration defaulthostconfig = getHostConfiguration();
- if (hostConfiguration == null || hostConfiguration == defaulthostconfig) {
+ if (hostconfig == null) {
+ hostconfig = defaulthostconfig;
+ }
+ URI uri = method.getURI();
+ if (hostconfig == defaulthostconfig || uri.isAbsoluteURI()) {
// make a deep copy of the host defaults
- hostConfiguration = new HostConfiguration(defaulthostconfig);
- URI uri = method.getURI();
+ hostconfig = new HostConfiguration(hostconfig);
if (uri.isAbsoluteURI()) {
- hostConfiguration.setHost(uri);
+ hostconfig.setHost(uri);
}
}
HttpMethodDirector methodDirector = new HttpMethodDirector(
this.httpConnectionManager,
- hostConfiguration,
+ hostconfig,
this.params,
(state == null ? getState() : state));
methodDirector.executeMethod(method);