hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip_...@avivacanada.com
Subject Re: Compatible issue solution of HttpClient and IBM WSAD environment
Date Mon, 29 Oct 2007 20:06:30 GMT
Oleg,

In my code, it has a condition.

if (localAddress == null) localaddr = InetAddress.getByName("localhost");

I am not sure whether this breaks the usage: ----"using
localAddress is to enable the the user to bind sockets to any local
network interface" 
 
By the way, I am just joined the team. I donot know how to prepare the 
changes in the unified diff format. Any doc or instruct?

Best Regards,

Philip She

Web Services and Infrastructure Software -BSD
Aviva Canada Inc.,
2206 Eglinton Avenue East, Scarborough, On. M1L 4S8
Tel: 416-2882667




Oleg Kalnichevski <olegk@apache.org> 
10/29/2007 12:06 PM
Please respond to
"HttpComponents Project" <httpcomponents-dev@jakarta.apache.org>


To
HttpComponents Project <httpcomponents-dev@jakarta.apache.org>
cc

Subject
Re: Compatible issue solution of HttpClient and IBM WSAD environment







On Fri, 2007-10-26 at 11:46 -0400, Philip_She@avivacanada.com wrote: 
> Ortwin,
> 
> I agree. Since the original code is not straight forward. I followed the 

> same coding approach. Below is the procedure. It would be much easy to 
> read.
> 
> The original one is:
> 
>         //  SocketFactory socketFactory = 
> Class.forName(socketfactoryName).getDefault();
>         //  Socket socket = socketFactory.createSocket();
>         //  SocketAddress localaddr = new 
InetSocketAddress(localAddress, 
> localPort);
>         //  SocketAddress remoteaddr = new InetSocketAddress(host, 
port);
>         //  socket.bind(localaddr);
>         //  socket.connect(remoteaddr, timeout);
>         //  return socket;
> 
> I changed to:
> 
>         //  SocketFactory socketFactory = 
> Class.forName(socketfactoryName).getDefault();
>           //  localaddr = InetAddress.getByName("localhost");


Philip,

Actually there is a problem with your patch. The whole point of using
localAddress is to enable the the user to bind sockets to any local
network interface, not just the default one. Your patch appears to just
overwrite that value with the default local address.

Could you please re-submit your changes in the unified diff format? 

Oleg

> //  SocketAddress remoteaddr = new InetSocketAddress(host, port);
>         //  Socket socket = socketFactory.createSocket(remoteaddr, new 
> Integer(port),localAddress, new Integer(localPort));
>         //  socket.connect(remoteaddr, timeout);
>         //  return socket;
> 
> 
> Best Regards,
> 
> Philip She
> 
> Web Services and Infrastructure Software -BSD
> Aviva Canada Inc.,
> 2206 Eglinton Avenue East, Scarborough, On. M1L 4S8
> Tel: 416-2882667
> 
> 
> 
> 
> Ortwin Gl├╝ck <odi@odi.ch> 
> 10/26/2007 11:30 AM
> Please respond to
> "HttpComponents Project" <httpcomponents-dev@jakarta.apache.org>
> 
> 
> To
> HttpComponents Project <httpcomponents-dev@jakarta.apache.org>
> cc
> 
> Subject
> Re: Compatible issue solution of HttpClient and IBM WSAD environment
> 
> 
> 
> 
> 
> 
> 
> 
> Philip_She@avivacanada.com wrote:
> > I am developing an application using HttpClient to access a HTTPS web 
> > application server in WSAD 5.1.2. But it failed because of IBM jsse 
does 
> 
> > not support httpclient. I tried to replace the IBM jsse using SUN's 
> Jsse. 
> > It seems not a good idea. I debugged this and find the reason. I made 
> some 
> > change and it works fine.
> > 
> > The problem is in class com.avivacanada.commons.httpclient.protocol.
> > ReflectionSocketFactory
> 
> Wow, that is a little hard to read. Am I seeing this right, that you are
> basically specifying the local address and port? Just out of curiosity, 
> what
> kind of error message do you get with the existing code?
> 
> Ortwin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpcomponents-dev-help@jakarta.apache.org
> 
> 


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



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