hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <ortwin.glu...@nose.ch>
Subject Re: Why is the HttpConnectionManager a field in HttpState?
Date Tue, 06 May 2003 07:25:26 GMT
Definitely ugly.

Laura Werner wrote:
> Hi,
> 
> I just discovered a sort of a gotcha with the patch I submitted on 
> Friday.  Imagine code like this:
> 
> HttpConnectionManager manager = new MultiThreadedHttpConnectionManager();
> HttpClient myClient = new HttpClient(manager);
> HttpState myState = new HttpState();
> ...
> myClient.executeMethod(hostConfig, method, myState);
> 
> This didn't behave the way I expected, because HttpClient.executeMethod 
> ends up calling HttpState.getHttpConnectionManager() to find the 
> connection manager to use.  I had naively expected it to use the manager 
> that I passed in to the constructor, but that one is only used for 
> constructing the HttpClient's default HttpState object.


Mime
View raw message