You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Olaf Sebelin <os...@bos-bremen.de> on 2006/06/21 10:18:03 UTC

Original method parameters not copied in HttpMethodDirector.executeConnect()

Hi,


in HttpMethodDirector.executeConnect() the parameters of the
hostConfiguration are applied as default parameters to the new
ConnnectMethod:

 this.connectMethod = new ConnectMethod();
 this.connectMethod.getParams().setDefaults(this.hostConfiguration.getParams());

This way, the parameters of the underlying original Method are not
copied to the ConnectMethod. 

So, if I set a method specific CredentialsProvider, like 

  GetMethod get = new GetMethod("https://somewhere.org"); //HTTPS!
  get.getParams().setParameter(CredentialsProvider.PROVIDER, this);

it won't get applied to the ConnnectMethods parameters.

Is this desired behaviour, thus it is not correct to set the
CredentialsProvider in a method-specific way?

Or should  HttpMethodDirector.executeConnect() be changed to something
like this (and I should file a bug report :)

 private boolean executeConnect(HttpMethod method) throws IOException, HttpException
 {
   this.connectMethod = new ConnectMethod();
   this.connectMethod.setParams(method.getParams());
   this.connectMethod.getParams().setDefaults(this.hostConfiguration.getParams());
  //...
 }


Thanks for your help && Kind regards
Olaf Sebelin

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: Original method parameters not copied in HttpMethodDirector.executeConnect()

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2006-06-21 at 10:18 +0200, Olaf Sebelin wrote:
> Hi,
> 
> 
> in HttpMethodDirector.executeConnect() the parameters of the
> hostConfiguration are applied as default parameters to the new
> ConnnectMethod:
> 
>  this.connectMethod = new ConnectMethod();
>  this.connectMethod.getParams().setDefaults(this.hostConfiguration.getParams());
> 
> This way, the parameters of the underlying original Method are not
> copied to the ConnectMethod. 
> 
> So, if I set a method specific CredentialsProvider, like 
> 
>   GetMethod get = new GetMethod("https://somewhere.org"); //HTTPS!
>   get.getParams().setParameter(CredentialsProvider.PROVIDER, this);
> 
> it won't get applied to the ConnnectMethods parameters.
> 
> Is this desired behaviour, thus it is not correct to set the
> CredentialsProvider in a method-specific way?

Olaf,

As far as I am concerned this is a desired behavior. One can always set
parameters at the host or client level to make them apply to all methods
executed against the given host or by the same client.

Oleg


> 
> Or should  HttpMethodDirector.executeConnect() be changed to something
> like this (and I should file a bug report :)
> 
>  private boolean executeConnect(HttpMethod method) throws IOException, HttpException
>  {
>    this.connectMethod = new ConnectMethod();
>    this.connectMethod.setParams(method.getParams());
>    this.connectMethod.getParams().setDefaults(this.hostConfiguration.getParams());
>   //...
>  }
> 
> 
> Thanks for your help && Kind regards
> Olaf Sebelin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org