hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerry Woods" <gerry.wo...@soa.com>
Subject HttpClient.executeMethod blows away the pased in HostConfiguration
Date Fri, 16 Mar 2007 01:01:34 GMT
Hi,

I'm new to this list so I apologise in advance if this is an
inappropriate forum for this question.  My issue is that I have multiple
"users" talking to potentially the same HTTPS target endpoint.  Because
each use may have a different identity, I want to invoke
HttpClient.executeMethod with my own HostConfiguration that contains my
own Protocol instance that in turn has a ProtocolSocketFactory specific
to the user with the appropriate credentials.  I would also like to
control the connection pools on a per-user basis.  Unfortunately,
HttpClient.exceuteMethod copies the HostConfiguration and overwrites the
HttpHost if the method's URI returns true from isAbsolute.  This blows
away my custom ProtoclSocketFactory in favour of the one registered
statically with the Protocol class.  I don't understand why the code is
written to copy the HostConfiguration and ignore the one that I pass in,
I was hoping someone could point me in the right direction or suggest an
alternative way to accomplish this.  The offending (from my point of
view) code in executeMethod is below:

 

        URI uri = method.getURI(); 

        if (hostconfig == defaulthostconfig || uri.isAbsoluteURI()) {

            // make a deep copy of the host defaults

            hostconfig = new HostConfiguration(hostconfig);

            if (uri.isAbsoluteURI()) {

                hostconfig.setHost(uri);

            }

        }

 

Thanks in advance.

Gerry


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message